generate_image
Submits an asynchronous text-to-image generation job with prompt, size, sampler, and LoRA controls, returning a job ID to poll for the result.
Instructions
Submit an async text-to-image generation job.
Runs the packaged SDXL workflow: loads the diffusion model, encodes the
prompt pair, samples, and decodes. Returns immediately with a job id --
poll get_job_status for the result.
Args:
prompt: What to generate.
negative_embedding: Textual-inversion embedding appended to the negative prompt.
negative_prompt: What to avoid.
width: Output width in pixels.
height: Output height in pixels.
steps: Sampling steps. More is slower and usually better.
cfg_scale: Classifier-free guidance. Higher follows the prompt harder.
sampler: Sampler name, as ComfyUI exposes it.
scheduler: Scheduler name, as ComfyUI exposes it.
lora: Single LoRA filename from comfyui/models/loras/.
lora_weight: Weight for lora.
loras: Several LoRAs at once, as [{"name": ..., "weight": ...}].
seed: Fixed seed for reproducibility. Omitted means a random one.
output_format: png keeps provenance metadata; other values do not.
Returns:
A job record with job_id, the resolved parameters, and the workflow path.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"prompt": "<prompt>"
},
"name": "generate_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lora | No | ||
| seed | No | ||
| loras | No | ||
| steps | No | ||
| width | No | ||
| height | No | ||
| prompt | Yes | ||
| sampler | No | euler_ancestral | |
| cfg_scale | No | ||
| scheduler | No | normal | |
| lora_weight | No | ||
| output_format | No | png | |
| negative_prompt | No | text, watermark, blurry, low quality | |
| negative_embedding | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||