Wan 2.7 · Image Editing
Edit up to nine reference images with one instruction
- image_urls
- images
- task id
Instruction editing is where image generation actually went in 2026 - the community's answer to character consistency stopped being "inject the face" and became "generate once, then edit that image." Wan 2.7's edit endpoint is a hosted version of that move: one to nine source images, one plain-English instruction, and $0.03 per returned image. It's uncensored, which is why a good chunk of its traffic isn't about products.
Vague prompts do badly here. Say what changes and what must stay - "keep the face and the jacket exactly, change the background to a dusk rooftop and cool the light" - because the model is editing a set of references, not starting over.
Inputs
image_urls is the socket that grows: connect one image and it handles one, connect nine and it composites them. Up to nine is a real range, and the ordering matters, because your instruction refers to them by position.
prompt is the edit. num_outputs takes the batch size - generate four and pick one, at four times the price. resolution is the output tier, 1k by default.
aspect_ratio defaults to model default, and the tooltip is worth reading closely: leave it alone and the output follows the proportions of the last source image, at the resolution tier you picked. Set it explicitly and you're overwriting that. This is the difference between an edit that fits back into your layout and one that doesn't.
Then the two JSON fields, which look intimidating and aren't:
bounding_boxes marks the areas to edit, in pixels from the top-left of the reference image each rectangle belongs to, up to two per image:
[{"image_index": 0, "x1": 120, "x2": 640, "y1": 80, "y2": 500}]
Use it when the instruction is precise - "retype the sign in this region" - and the model keeps wandering elsewhere. Reading coordinates off the image in any editor is enough.
color_palette pins the palette, 3 to 10 colours, each with an optional share of the frame in percent:
[{"hex": "#1b2a41", "ratio": 40}, {"hex": "#e8d5b7", "ratio": 35}, {"hex": "#c1622d"}]
Leave the ratios out and they split evenly. It's the fastest way to make a set of edits look like they came from the same shoot.
seed repeats a draw exactly - the sane way to compare two phrasings of the same edit.
Outputs are images (a batch, so downstream nodes see several frames) and task id.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/spicyapi-ai/comfyui-spicyapi
Restart, then Settings > SpicyAPI and paste a key from spicyapi.ai/console/keys - or install through ComfyUI Manager by searching "SpicyAPI". Nothing else is required: no weights, no extra Python, no GPU. Uploads are handled for you, with images re-encoded as PNG when they fit under 10 MiB and high-quality JPEG when they don't. The key lives in the ComfyUI user folder instead of a node widget, so it can't leak through a shared workflow or an image's metadata; SPICY_API_KEY covers remote machines.
What catches people
Attaching more references raises the quote - each image you add costs something, so don't wire nine "just in case." The node badge is a rate per image, not a total; num_outputs multiplies it. Set Max cost per run in the SpicyAPI settings so a four-image batch can't surprise you.
If an edit sticks at the wrong scale, it's usually aspect_ratio: leaving it on the default follows your last source, which is right for a layout and wrong when you're deliberately changing the shape.
Errors read cleanly: 40004 means no deployment serves that combination and the message names the parameter; 40003 means an upload didn't match its ticket, so re-run the node; 40310 is an unverified account email; 50302 means the generation failed upstream and was refunded. Keep No SpicyAPI key is set in mind too - it's the one people hit after moving ComfyUI to a new machine. And cancelling in ComfyUI doesn't stop the job server-side, so check your console (14 days of history) before paying for the same edit twice.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Describe the image to produce from the source: subject, composition, style, and lighting. | |
| image_urls | COMFY_AUTOGROW_V3 | Source images that you are authorised to process. | |
| bounding_boxes | STRING | Rectangles marking the areas to edit, in pixels from the top-left corner of the reference image each one belongs to. Up to 2 per image. JSON. A list of objects with "image_index", "x1", "x2", "y1", "y2". | |
| aspect_ratio | COMBO | model default | Aspect ratio of the generated image. Omit it to follow the proportions of the last source image. |
| num_outputs | INT | 11–4 | How many images to generate in one run. |
| resolution | COMBO | 1k | Output resolution tier. With aspect_ratio omitted, the output follows the last source image's proportions at this tier. |
| color_palette | STRING | Custom colour theme: 3 to 10 colours, each with an optional share of the image in percent. Leave the shares empty to split them evenly. JSON. A list of objects with "hex", "ratio"?. | |
| seed | INT | 00–2147483647 | Same seed and settings, same result. Set 'control after generate' to randomize to get a new result on every run; every run is billed. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| task id | STRING | The SpicyAPI task id, for the console logs or support. |