Single-shot precise local edit, source-fidelity-first
Flux Kontext
Generate from scratch with GPT Image 2
sibling
gpt-image-2
skill
Batch SKU galleries with stable identity
Nano Banana Edit
Prerequisites
RunComfy CLI
—
npm i -g @runcomfy/cli
RunComfy account
—
runcomfy login
opens a browser device-code flow.
CI / containers
— set
RUNCOMFY_TOKEN=
instead of
runcomfy login
.
Endpoints + input schema
openai/gpt-image-2/edit
Field
Type
Required
Default
Notes
prompt
string
yes
—
Edit instruction. Lead with preservation, end with the change.
images
string[]
yes
—
Up to 10
publicly-fetchable HTTPS URLs. First is primary; rest are auxiliary.
size
enum
no
auto
auto
(preserve input),
1024_1024
(1:1),
1024_1536
(2:3 portrait),
1536_1024
(3:2 landscape).
size=auto
preserves the input ratio — strongly recommended unless the edit explicitly changes framing.
How to invoke
Single-ref preservation edit:
runcomfy run openai/gpt-image-2/edit
\
--input
'{
"prompt": "Keep the person'
\
'
's face, pose, and brand mark unchanged. Replace the background with a soft warm-grey studio sweep and a gentle floor shadow.",
"images": ["https://.../portrait.jpg"]
}'
\
--output-dir
<
absolute/path
>
Multilingual text rewrite (preserve everything except the headline):
runcomfy run openai/gpt-image-2/edit
\
--input
'{
"prompt": "Keep the photograph, layout, and brand mark exactly as in the input. Replace only the in-image headline. The new headline reads \"今日のおすすめ\" in bold Japanese kana, same position and font weight as before.",
"images": ["https://.../poster-en.jpg"]
}'
\
--output-dir
<
absolute/path
>
Multi-ref composition:
runcomfy run openai/gpt-image-2/edit
\
--input
'{
"prompt": "Compose subject from image 1 into the room from image 2. Match the lighting and color palette of image 2. Keep image 1 subject identity (face, pose, clothing) unchanged.",
, polls the request, fetches the result, and downloads any
.runcomfy.net
/
.runcomfy.com
URL into
--output-dir
.
Ctrl-C
cancels the remote request before exit.
Security & Privacy
Token storage
:
runcomfy login
writes the API token to
~/.config/runcomfy/token.json
with mode 0600 (owner-only read/write). Set
RUNCOMFY_TOKEN
env var to bypass the file entirely in CI / containers.
Input boundary
the user prompt is passed as a JSON string to the CLI via
--input
. The CLI does NOT shell-expand the prompt; it transmits the JSON body directly to the Model API over HTTPS. No shell injection surface from prompt content.
Third-party content
image / mask / video URLs you pass are fetched by the RunComfy model server, not by the CLI on your machine. Treat external URLs as untrusted; image-based prompt injection is a known risk for any image-edit / video-edit model.
Outbound endpoints
only
model-api.runcomfy.net
(request submission) and
*.runcomfy.net
/
*.runcomfy.com
(download whitelist for generated outputs). No telemetry, no callbacks.
Generated-file size cap
the CLI aborts any single download > 2 GiB to prevent disk-fill from a malicious or runaway model output.