
The Z-Image: Text to Image workflow is designed to transform textual descriptions into high-quality images with a focus on photorealism and aesthetic diversity. Utilizing the Z-Image model, this workflow is particularly adept at producing images that are not only visually stunning but also highly responsive to both positive and negative prompts, allowing for fine-tuning and creative exploration. The workflow employs specific nodes such as SaveImage for output management and MarkdownNote for documentation, alongside a unique node type identified by the ID 9b9009e4-2d3d-445f-9be5-6063f465757e, which plays a crucial role in the image generation process.
Technically, this workflow leverages the qwen_3_4b.safetensors text encoder and the z_image_bf16.safetensors diffusion model to interpret and render textual inputs into images. The process involves running the diffusion model for 30 to 50 steps with a classifier-free guidance (cfg) scale of 3 to 5, ensuring a balance between adhering to the prompt and introducing creative variability. This setup makes the workflow particularly useful for artists and designers seeking to generate diverse image outputs from textual descriptions, providing a foundation for creative freedom and exploration.
API
Use this workflow from code
Every Comfy workflow is a JSON graph. The payload below is this workflow, exactly as ComfyUI runs it — fetch it from the URL, keep it in version control, or load it in ComfyUI and run it node by node.
Run it from TypeScript or Python with the Comfy SDK. The same code targets Comfy Cloud or a ComfyUI you host yourself — only the base URL changes.
// Install (beta)
npm i @comfyorg/sdk
// Run "Z-Image: Text to Image" (TypeScript)
import { Comfy } from "@comfyorg/sdk";
const client = new Comfy({ apiKey: "comfyui-..." });
// This workflow, exported in API format (see note below)
const wf = await client.workflows.fromFile("image_z_image_api.json");
const job = await client.run(wf);
await job.getOutputs("95")[0].toFile("output.png"); // SaveImageAdvancedThe SDK takes a workflow in API format: open this workflow in ComfyUI and use File → Export Workflow (API).
Comfy Cloud API access requires a plan with an API key.
FAQ













