image-outpainting

Extend image canvas beyond original bounds, change aspect ratio, and fill in uncropped areas. Routes across four specialized edit models (Nano Banana 2, GPT Image 2, FLUX Kontext Pro, and brand endpoints) based on whether the outpaint is prompt-driven, reference-style matched, or brand-locked Nano Banana 2 Edit is the default, optimized for spatial-language prompts ("extend left and right by 30%") and aspect-ratio changes (square to 16:9, portrait to landscape) Supports up to 10 reference images via GPT Image 2 Edit for composite outpaints and layout repositioning during canvas extension Invoked via runcomfy run CLI with JSON input specifying prompt, image URLs, and optional aspect ratio; results download to a local directory

INSTALLATION
npx skills add https://github.com/agentspace-so/runcomfy-agent-skills --skill image-outpainting
Run in your project or agent environment. Adjust flags if your CLI version differs.

SKILL.md

Image Outpainting

Extend a still beyond its original canvas — uncrop, change aspect ratio, fill in what the camera didn't capture. This skill routes across the identity-preserving edit endpoints in the RunComfy catalog, picking the right one for prose-driven extension, reference-style matching, or brand-locked continuation.

runcomfy.com · best-image-editing-models · CLI docs

Powered by the RunComfy CLI

# 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 ./out

CLI deep dive: [`runcomfy-cli`](https://www.skills.sh/agentspace-so/runcomfy-agent-skills/runcomfy-cli) skill.

---

## Pick the right model

Listed by suitability for outpainting workflows.

**Nano Banana 2 Edit** — `google/nano-banana-2/edit` *(default for prompt-shaped outpaint)*

> Identity-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.

**GPT Image 2 Edit** — `openai/gpt-image-2/edit`

> Up 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.

**FLUX Kontext Pro** — `blackforestlabs/flux-1-kontext/pro/edit`

> Single-instruction, high-preservation edit. Use form: `"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."`

> Pick for: single-shot outpaint with maximum preservation of the original content.

**Seedream / Dreamina / Qwen / FLUX 2 edit endpoints**

> Brand-specific edit endpoints (`bytedance/seedream-5/lite/edit`, `bytedance/dreamina-4-0/edit`, `qwen/qwen-image/qwen-image-edit-2511`, `blackforestlabs/flux-2-pro/edit`, etc.).

> Pick for: keeping the outpaint within the same brand/style as the source generation. See [`image-edit`](https://www.skills.sh/agentspace-so/runcomfy-agent-skills/image-edit) for the full edit router.

---

## Route 1: Nano Banana 2 Edit — default

**Model**: `google/nano-banana-2/edit`

**Catalog**: [Nano Banana 2 Edit](https://www.runcomfy.com/models/google/nano-banana-2/edit?utm_source=skills.sh&utm_medium=skill&utm_campaign=image-outpainting)

### Invoke

**Aspect-ratio change (1:1 → 16:9):**

runcomfy 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 ./out


**Uncrop a portrait (reveal more body):**

runcomfy 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

BrowserAct

Let your agent run on any real-world website

Bypass CAPTCHA & anti-bot for free. Start local, scale to cloud.

Explore BrowserAct Skills →

Stop writing automation&scrapers

Install the CLI. Run your first Skill in 30 seconds. Scale when you're ready.

Start free
free · no credit card