Nodes/ComfyUI-BAGEL/BAGEL Image Edit
ComfyUI Node

BAGEL Image Edit

The node that made BAGEL famous

By neverbiasu·Created about a year ago·Updated 18 days ago· 188
BAGEL Image Edit
  • model
  • image
  • vae_latent
  • latent
  • reasoning
promptShe boards a modern subway, quietly reading a folded newspaper, wearing the same clothes.
cfg_text_scale4.0
cfg_img_scale2.0
cfg_interval0.0
timestep_shift3.0
num_timesteps50
cfg_renorm_min0.0
cfg_renorm_typetext_channel
show_thinkingfalse
max_think_tokens1024
do_samplefalse
text_temperature0.3
seed0

This is the party trick. "Keep the same person, same clothes, but put her on a modern subway reading a newspaper" - and it actually keeps the person. That's BAGEL Image Edit, and it's the reason the model exploded in the first place: it does the kind of instruction-following edit that GPT-4o could do and that Flux-Kontext made you fight for. By spring 2025 people were already fine-tuning on top of it to beat Kontext on image editing. If you're going to run any part of this pack, it's probably this node.

How it works - the dual-path setup

This is the one BAGEL node that wants two views of the same image, and it's also the one where beginners trip. Look at its inputs: it needs both an image (IMAGE) and a vae_latent (LATENT). The image goes to BAGEL's SigLIP/NaViT vision tower; the latent is the same picture run through the official FLUX VAEEncode, giving the model the pixel-level conditioning. Internally it builds a text-only context and an image-only context, then samples with both your text scale and image scale applied.

The catch, from the author's own tooltips: the image you send must be the same preprocessed image you sent to VAEEncode. Same pixels, same size. The workflow that works is:

  1. Load your source image.
  2. Run it through an official ImageScale node - 16-aligned dimensions, short side at least 512 px, long side at most 1024 px (that's BAGEL's own preprocessing range).
  3. Branch that exact resized image: one copy into VAEEncode (FLUX AE loaded by the official VAELoader), the other into this node's image input, and the VAEEncode latent into vae_latent.

The node validates this for you - if the image and latent describe different sizes, it throws a clear error telling you to connect the same preprocessed image to both. Batch size 1 only; one edit per execution.

Inputs and outputs that matter

  • prompt - plain-language instruction. The default ("She boards a modern subway, quietly reading a folded newspaper, wearing the same clothes") is literally the model's demo move.
  • cfg_text_scale (default 4) - how strongly it follows the edit instruction.
  • cfg_img_scale (default 2) - how strongly it preserves the input image's details. This is the fidelity dial: crank it up when edits drift, ease off when the model refuses to change anything.
  • cfg_interval (default 0) - start of the CFG interval, end pinned at 1.0.
  • timestep_shift (default 3, allowed up to 10 here) - higher favors layout, lower favors detail.
  • num_timesteps (default 50), cfg_renorm_type (default text_channel - the official image-edit setting), seed (0 = unset, positive = reproducible).
  • The thinking cluster (show_thinking, max_think_tokens, do_sample, text_temperature) - turn it on to have BAGEL plan the edit in text before sampling.

Outputs: latent (LATENT, decode with official VAEDecode + FLUX AE) and reasoning (STRING, the planning text when thinking is enabled).

Installing and what to expect

Shared pack setup: clone https://github.com/neverbiasu/ComfyUI-BAGEL into custom_nodes, pip install -r requirements.txt, drop the single-file BAGEL .safetensors into models/bagel/ and FLUX ae.safetensors into models/vae/, restart. ComfyUI Manager users: search "ComfyUI-BAGEL". The bagel_image_editing.json example workflow is the easiest way to see the ImageScale → VAEEncode wiring done right.

Expect it to be slow and hungry. The README's own validation ran on an A100 and calls high-VRAM the recommendation; the legacy full-precision era reported 30 GB at 1024×1024. If you're under ~24 GB, get an FP8 or INT8 variant of the model first. The node itself is strict about sizes precisely so you fail with a readable error instead of a mysterious broken image - a small mercy in a pack where the model is the bottleneck.

CategoryBAGEL/Editing

Inputs (16)

NameTypeDefaultDescription
modelBAGEL_MODELNative BAGEL model from BAGEL Model Loader.
imageIMAGESource image for BAGEL's ViT encoder. It must be the same preprocessed image sent to VAEEncode.
vae_latentLATENTOutput of the official FLUX VAEEncode on the same preprocessed source image.
promptSTRINGShe boards a modern subway, quietly reading a folded newspaper, wearing the same clothes.Instruction describing the requested edit.
cfg_text_scaleFLOAT4.01–8Controls how strongly BAGEL follows the edit prompt.
cfg_img_scaleFLOAT2.01–4Controls preservation of input-image details.
cfg_intervalFLOAT0.00–1Start of the CFG interval. The end is fixed at 1.0.
timestep_shiftFLOAT3.01–10Shifts denoising-step allocation: higher favours layout, lower favours detail.
num_timestepsINT5010–100Total denoising steps.
cfg_renorm_minFLOAT0.00–1CFG-Renorm minimum. 1.0 disables CFG-Renorm.
cfg_renorm_typeCOMBOtext_channelCFG-Renorm method. text_channel is the official image-edit default.
show_thinkingBOOLEANfalseGenerate and return the model planning text before image sampling.
max_think_tokensINT102464–4096Maximum planning tokens when Thinking is enabled.
do_sampleBOOLEANfalseEnable sampling for planning-text generation when Thinking is enabled.
text_temperatureFLOAT0.30.1–1Planning-text randomness when Thinking is enabled.
seedINT00–10000000 leaves the seed unset, matching the official app; positive values are reproducible.

Outputs (2)

NameTypeDescription
latentLATENT
reasoningSTRING