ImageGenerationRequest - Go SDK

ImageGenerationRequest type definition

The Go SDK and docs are currently in beta. Report issues on GitHub.

Image generation request input

Fields

FieldTypeRequiredDescriptionExample
AspectRatio*components.ImageGenerationRequestAspectRatioNormalized aspect ratio of the generated image. Providers clamp to their supported subset.16:9
Background*components.ImageGenerationRequestBackgroundBackground treatment. transparent requires an output_format that supports alpha (png or webp).auto
InputReferences[]components.ContentPartImageReference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs.
Modelstring✔️The image generation model to usebytedance-seed/seedream-4.5
N*int64Number of images to generate (1-10). Providers that only support single-image generation reject n > 1.1
OutputCompression*int64Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob.100
OutputFormat*components.ImageGenerationRequestOutputFormatEncoding of the returned image bytes.png
Promptstring✔️Text description of the desired imagea red panda astronaut floating in space, studio lighting
Provider*components.ImageGenerationRequestProviderProvider-specific passthrough configuration
Quality*components.ImageGenerationRequestQualityRendering quality. Providers without a quality knob ignore this.high
Resolution*components.ImageGenerationRequestResolutionNormalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.2K
Seed*int64If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers.
Size*stringOptional. A convenience shorthand for output dimensions — pass a tier (“2K”, “4K”) or explicit pixels (“2048x2048”) and we normalize it to the right dimensions for the chosen provider. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected.2K
Stream*boolIf true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response.