generate_image
Turn text prompts into images with NVIDIA NIM models. Adjust resolution, sampler, scheduler, and save output as PNG.
Instructions
Generate images from text prompts using NVIDIA NIM image generation models (Stable Diffusion XL, SDXL Turbo, SD3, FLUX.1). Supports various resolutions, samplers, and schedulers. FLUX.1-schnell and FLUX.1-kontext-dev are available on the free NVIDIA AI Foundation tier. Can save generated images as PNG files to disk.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | Random seed for reproducibility | |
| image | No | Base64 data URL of input image (required for FLUX Kontext image-to-image editing, format: data:image/png;base64,...) | |
| model | No | Image generation model ID (e.g., nvidia/stable-diffusion-xl, nvidia/sdxl-turbo, stabilityai/sd-3-medium, black-forest-labs/flux.1-dev, black-forest-labs/flux.1-schnell, black-forest-labs/flux.1-kontext-dev) | |
| steps | No | Number of diffusion steps (ignored for FLUX Schnell, fixed at 4) | |
| width | No | Image width in pixels | |
| height | No | Image height in pixels | |
| prompt | Yes | Text prompt describing the image to generate | |
| sampler | No | Sampler algorithm (e.g., euler, euler_a, dpmpp_2m, dpmpp_sde, ddim) | |
| cfg_scale | No | Classifier-free guidance scale | |
| save_path | No | Optional file path to save the generated image as PNG (e.g., './output/image.png' or '/absolute/path/image.png') | |
| scheduler | No | Scheduler type (e.g., karras, exponential, simple, ddim_uniform) | |
| num_images | No | Number of images to generate | |
| aspect_ratio | No | Aspect ratio for output (e.g., 'match_input_image', '1:1', '16:9', '4:3', '3:4', '21:9') | |
| save_filename | No | Optional filename (without extension) to auto-generate path in current directory (e.g., 'my-image' creates './my-image.png') | |
| negative_prompt | No | Negative prompt to avoid unwanted features | |
| response_format | No | Response format: URL or base64 JSON | url |