new·Earn with mozg — 20% of every monthSend somebody here and take a fifth of every plan payment they make, for as long as they keep paying — not a bounty on the first invoice. Your handle is the link, the window is thirty days, and the commission lands on your balance the second they pay. Free to join: if you have signed in, you already have the link. mozg.sh/earnall news →
mozg.beta
Sign in

AI SDK · Providers · all subjects

image generation & vision

6 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

DeepSeek image input formats

DeepSeek accepts JPEG, PNG, GIF, and WebP image inputs. HTTP image URLs can be at most 8,192 characters. DeepSeek file uploads support JPEG (.jpg and .jpeg), PNG, GIF, and WebP images. Each file can be at most 64 MiB, and filenames can contain at most 512 characters.

DeepSeek image input example

Example with image input and imageDetail: `{ type: 'file', data: new URL('https://example.com/image.webp'), mediaType: 'image/webp', providerOptions: { deepseek: { imageDetail: 'low' } } }`

DeepSeek file upload example

Example of file upload: `const { providerReference, mediaType } = await uploadFile({ api: deepSeek.files(), data: await readFile('./image.png'), filename: 'image.png', providerOptions: { deepseek: { expiresAfter: 3600 } } }); const { text } = await generateText({ model: deepSeek('deepseek-v4-flash-vision-exp'), messages: [{ role: 'user', content: [{ type: 'text', text: 'Describe this image.' }, { type: 'file', mediaType: mediaType ?? 'image/png', data: providerReference }] }] });`

ByteDance text-to-image generation example

Example of generating an image from a text prompt: import { byteDance, type ByteDanceImageModelOptions } from '@ai-sdk/bytedance'; import { generateImage } from 'ai'; const { image } = await generateImage({ model: byteDance.image('seedream-5-0-260128'), prompt: 'A salamander in a forest pond at dusk surrounded by fireflies', size: '2048x2048', providerOptions: { bytedance: { watermark: false, } satisfies ByteDanceImageModelOptions, }, });

ByteDance image-to-image generation example

Example of transforming an existing image via image-to-image: import { readFileSync } from 'node:fs'; import { byteDance, type ByteDanceImageModelOptions } from '@ai-sdk/bytedance'; import { generateImage } from 'ai'; const inputImage = readFileSync('./input-image.png'); const { image } = await generateImage({ model: byteDance.image('seedream-5-0-260128'), prompt: { text: 'Change the salamander to a snow weasel', images: [inputImage], }, providerOptions: { bytedance: { watermark: false, } satisfies ByteDanceImageModelOptions, }, });

ByteDance multi-image blending example

Example of multi-image blending to combine styles from multiple references: import { byteDance, type ByteDanceImageModelOptions } from '@ai-sdk/bytedance'; import { generateImage } from 'ai'; const { image } = await generateImage({ model: byteDance.image('seedream-5-0-260128'), prompt: { text: 'Replace the clothing in image 1 with the outfit from image 2', images: ['https://example.com/model.png', 'https://example.com/outfit.png'], }, providerOptions: { bytedance: { watermark: false, } satisfies ByteDanceImageModelOptions, }, });

Give your agent this brain