Image Generation Submit and Poll
A 3-step recipe with Civitai. We can help you get access.
Recipe · 3 steps
Image Generation Submit and Poll
with Civitai · Artificial Intelligence Management
Submit an imageGen workflow, poll to completion, and read the outputs.
- Submit a single imageGen step with the supplied prompt and engine and capture the new workflow id.
- Poll the workflow until it reaches a terminal state. While the workflow is still processing, loop back and poll again; on success continue to read the outputs.
- Read the completed workflow and collect the generated output blob URLs from the first step's first job.
What you'll need to have ready
- apiKey: Civitai personal API token used as a Bearer credential.
- engine: Generation engine identifier (e.g. flux2, sdxl, sd1, z-image).
- prompt: The positive text prompt for the image.
- negativePrompt: Optional negative prompt.
- width: Output image width in pixels.
- height: Output image height in pixels.
- steps: Number of sampling steps.
- cfgScale: Classifier-free guidance scale.
- quantity: Number of images to generate (1-10).
For your developer
Arazzo workflow civitai:image-generation-poll, 3 operations: submitWorkflow → getWorkflow → getWorkflow. Specs on APIs.io.