ImageGenerationRequest - Go SDK
ImageGenerationRequest - Go SDK
ImageGenerationRequest type definition
The Go SDK and docs are currently in beta. Report issues on GitHub.
Image generation request input
Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
AspectRatio | *components.ImageGenerationRequestAspectRatio | ➖ | Normalized aspect ratio of the generated image. Providers clamp to their supported subset. | 16:9 |
Background | *components.ImageGenerationRequestBackground | ➖ | Background treatment. transparent requires an output_format that supports alpha (png or webp). | auto |
InputReferences | []components.ContentPartImage | ➖ | Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs. | |
Model | string | ✔️ | The image generation model to use | bytedance-seed/seedream-4.5 |
N | *int64 | ➖ | Number of images to generate (1-10). Providers that only support single-image generation reject n > 1. | 1 |
OutputCompression | *int64 | ➖ | Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. | 100 |
OutputFormat | *components.ImageGenerationRequestOutputFormat | ➖ | Encoding of the returned image bytes. | png |
Prompt | string | ✔️ | Text description of the desired image | a red panda astronaut floating in space, studio lighting |
Provider | *components.ImageGenerationRequestProvider | ➖ | Provider-specific passthrough configuration | |
Quality | *components.ImageGenerationRequestQuality | ➖ | Rendering quality. Providers without a quality knob ignore this. | high |
Resolution | *components.ImageGenerationRequestResolution | ➖ | Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. | 2K |
Seed | *int64 | ➖ | If 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 | *string | ➖ | Optional. 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 | *bool | ➖ | If 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. |