Loading...
Loading...
Image outpainting on RunComfy via the `runcomfy` CLI — extend a still beyond its original canvas, fill in what the camera didn't capture, change aspect ratio (square → 16:9, portrait → landscape) while preserving the original content. Routes across Nano Banana 2 Edit (default, spatial-language driven), GPT Image 2 Edit (multi-ref with reference-style matching), FLUX Kontext Pro (single-shot maximum-preservation), and the brand edit endpoints (Seedream / Dreamina / Qwen / FLUX 2). Picks the right route based on whether the outpaint is prose-driven, reference-driven, or brand-locked. Triggers on "outpaint", "outpainting", "extend image canvas", "expand the image", "fill in around the photo", "uncrop", "change aspect ratio", "extend frame", "wide-screen from square", or any explicit ask to add canvas around an existing still.
npx skill4agent add agentspace-so/runcomfy-agent-skills image-outpainting# 1. Install (see runcomfy-cli skill for details)
npm i -g @runcomfy/cli # or: npx -y @runcomfy/cli --version
# 2. Sign in
runcomfy login # or in CI: export RUNCOMFY_TOKEN=<token>
# 3. Outpaint
runcomfy run google/nano-banana-2/edit \
--input '{"prompt": "...extend canvas...", "image_urls": ["..."]}' \
--output-dir ./outruncomfy-cligoogle/nano-banana-2/editIdentity-preserving edit; honors spatial language ("extend the canvas to the left and right by ~30%", "add sky above the building"). The result is a wider canvas with the original content preserved. Pick for: aspect-ratio change (square → 16:9), uncrop a portrait, extend a landscape photo with matching environment. Avoid for: pixel-precise extension matching texture seams — use a ComfyUI outpainting workflow.
openai/gpt-image-2/editUp to 10 reference images, layout-precise instruction following. Useful when outpainting needs to match a reference style or includes layout repositioning. Pick for: composite outpaint (extend canvas + paste in element from another image), layout repositioning during the canvas change. Avoid for: simple outpaint without external references.
blackforestlabs/flux-1-kontext/pro/editSingle-instruction, high-preservation edit. Use form:Pick for: single-shot outpaint with maximum preservation of the original content."Extend the canvas to a 16:9 aspect ratio. Add matching sky and architecture continuing from the existing scene. Keep everything in the original image exactly."
Brand-specific edit endpoints (,bytedance/seedream-5/lite/edit,bytedance/dreamina-4-0/edit,qwen/qwen-image/qwen-image-edit-2511, etc.). Pick for: keeping the outpaint within the same brand/style as the source generation. Seeblackforestlabs/flux-2-pro/editfor the full edit router.image-edit
google/nano-banana-2/editruncomfy run google/nano-banana-2/edit \
--input '{
"prompt": "Extend the canvas to a 16:9 aspect ratio by adding matching environment on the left and right sides of the image. Continue the existing background style — same lighting, same camera distance, same color palette. Keep the original subject, pose, framing, and central content exactly as in the input.",
"image_urls": ["https://your-cdn.example/portrait-1to1.jpg"],
"aspect_ratio": "16:9"
}' \
--output-dir ./outruncomfy run google/nano-banana-2/edit \
--input '{
"prompt": "Extend the canvas downward to show the subject's full upper body and arms. Continue the existing clothing style, lighting, and background. Keep the face and current visible area exactly as in the input.",
"image_urls": ["https://your-cdn.example/head-and-shoulders.jpg"]
}' \
--output-dir ./out"Extend the canvas to [aspect]""Extend downward""Extend on both sides by ~30%""Keep [original visible area] exactly as in the input"aspect_ratioimages: [original, style-ref]comfyui-image-outpainting-workflowflux-klein-unified-image-editing-inpaint-remove-outpaint-in-comfyui-advanced-image-restorationaspect_ratio: "9:16"aspect_ratio: "21:9""16:9"image-inpaintingvideo-outpaintingbest-image-editing-modelsnano-bananaflux-kontextseedream| code | meaning |
|---|---|
| 0 | success |
| 64 | bad CLI args |
| 65 | bad input JSON / schema mismatch |
| 69 | upstream 5xx |
| 75 | retryable: timeout / 429 |
| 77 | not signed in or token rejected |
runcomfy run--output-dirnpm i -g @runcomfy/clinpx -y @runcomfy/cliruncomfy login~/.config/runcomfy/token.jsonRUNCOMFY_TOKEN--inputmodel-api.runcomfy.net*.runcomfy.net*.runcomfy.comBash(runcomfy *)runcomfy-cliimage-editimage-inpaintingai-image-generationvideo-outpainting