Nodes/SpicyAPI/Image Expander · Expand Image
ComfyUI Node

Image Expander · Expand Image

Outpaint to a new aspect ratio without painting a mask

By spicyapi-ai·Created 21 days ago·Updated 2 days ago· 2
Image Expander · Expand Image
  • image_url
  • images
  • task id
◄aspect_ratio1:1►
◄output_formatPNG►
◄seed0►

The workflow nobody enjoys doing by hand

The old way to outpaint was mechanical: put the image on a bigger canvas, mask the empty band, pick a fill mode, hope the sampler continued the scene instead of inventing a new horizon, and then do it again for the other axis. It works. It's also four nodes and a dozen attempts for what is conceptually a single sentence - "make this a widescreen shot".

Image Expander is that sentence. $0.024 per image, one aspect-ratio dropdown, and the original stays exactly where it was while matching scenery gets painted into the empty space. Instruction-editing models took outpainting cleanly, and this is the packaged version of that move.

How it works

Your photo is uploaded, set inside a larger frame at the target shape, and the surrounding scenery is generated to match so the whole thing reads as one photograph - same light direction, same palette, same lens character, no visible seam. It calls spicyapi/image-expander-v1/edit and returns the result as a ComfyUI IMAGE.

Two things to hold on to. The long edge is always 1536 pixels, so a portrait source expanded to 16:9 comes back softer per-pixel than a small landscape source expanded to the same shape - the model is dividing a fixed budget. And there's no prompt and no seed here: you don't describe what should appear in the new space, the model infers it. That's the trade for the simplicity, and it's usually the right trade.

Inputs and outputs

image_url (IMAGE) - the photo to expand. It's set inside the larger frame; the original pixels aren't regenerated.

aspect_ratio - 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, default 1:1. Pick the target shape, not a direction. A 4:3 photo heading for a 16:9 thumbnail is 16:9. Going 1:1 on a landscape shot adds top and bottom, which is the wrong call for a phone wall and the right one for a square listing image.

output_format - png, jpeg or webp, default png.

Outputs: images (IMAGE) and task id (STRING).

Install

Manager → search SpicyAPI, or:

cd ComfyUI/custom_nodes
git clone https://github.com/spicyapi-ai/comfyui-spicyapi

Restart. Nothing to install beyond the pack itself - no dependencies, no local model, no GPU, since the inference runs on SpicyAPI's servers. Python 3.10+ and a ComfyUI with the V3 node API. Paste your key into Settings > SpicyAPI (or set SPICY_API_KEY), restart once so the node list mirrors your account, and set Max cost per run - this node is cheap enough to batch, which is exactly how a batch gets expensive.

What to expect

  • It fills, it doesn't compose. The new space gets scenery that fits; it won't stage a new subject in it. If you want a person added to the empty half, that's an edit model's job, not this one.
  • Faces and text near the edges can drift. Anything already at the boundary gets the least context, so leave a margin when you shoot or crop before expanding.
  • Output is committed to 1536 on the long edge. Don't expand and then try to crop back to a larger original size - you'll lose resolution. If the final image needs to be big, expand first and upscale after, or reach for Image Upscaler.
  • The "it didn't change anything" report is usually a wrong aspect pick: a 3:2 source pushed to 3:2 has nothing to do. Check the source shape.
  • 40004 no deployment serves this combination means the option combination isn't served right now - change the field named in the error rather than re-queueing.
CategorySpicyAPI/Image/Tools

Inputs (4)

NameTypeDefaultDescription
image_urlIMAGEPhoto to expand. It is set inside a larger frame and new scenery is painted around it.
aspect_ratioCOMBO1:1Shape of the finished image. The long edge is always 1536 pixels.
output_formatCOMBOPNGFile format of the returned image.
seedINT00–2147483647This model takes no seed, so the number is never sent. Changing it makes ComfyUI run the node again: set 'control after generate' to randomize for a new result on every run; every run is billed.

Outputs (2)

NameTypeDescription
imagesIMAGE—
task idSTRINGThe SpicyAPI task id, for the console logs or support.