BAGEL Image Edit
The node that made BAGEL famous
- model
- image
- vae_latent
- latent
- reasoning
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:
- Load your source image.
- Run it through an official
ImageScalenode - 16-aligned dimensions, short side at least 512 px, long side at most 1024 px (that's BAGEL's own preprocessing range). - Branch that exact resized image: one copy into
VAEEncode(FLUX AE loaded by the officialVAELoader), the other into this node'simageinput, and theVAEEncodelatent intovae_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.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| model | BAGEL_MODEL | Native BAGEL model from BAGEL Model Loader. | |
| image | IMAGE | Source image for BAGEL's ViT encoder. It must be the same preprocessed image sent to VAEEncode. | |
| vae_latent | LATENT | Output of the official FLUX VAEEncode on the same preprocessed source image. | |
| prompt | STRING | She boards a modern subway, quietly reading a folded newspaper, wearing the same clothes. | Instruction describing the requested edit. |
| cfg_text_scale | FLOAT | 4.01–8 | Controls how strongly BAGEL follows the edit prompt. |
| cfg_img_scale | FLOAT | 2.01–4 | Controls preservation of input-image details. |
| cfg_interval | FLOAT | 0.00–1 | Start of the CFG interval. The end is fixed at 1.0. |
| timestep_shift | FLOAT | 3.01–10 | Shifts denoising-step allocation: higher favours layout, lower favours detail. |
| num_timesteps | INT | 5010–100 | Total denoising steps. |
| cfg_renorm_min | FLOAT | 0.00–1 | CFG-Renorm minimum. 1.0 disables CFG-Renorm. |
| cfg_renorm_type | COMBO | text_channel | CFG-Renorm method. text_channel is the official image-edit default. |
| show_thinking | BOOLEAN | false | Generate and return the model planning text before image sampling. |
| max_think_tokens | INT | 102464–4096 | Maximum planning tokens when Thinking is enabled. |
| do_sample | BOOLEAN | false | Enable sampling for planning-text generation when Thinking is enabled. |
| text_temperature | FLOAT | 0.30.1–1 | Planning-text randomness when Thinking is enabled. |
| seed | INT | 00–1000000 | 0 leaves the seed unset, matching the official app; positive values are reproducible. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |
| reasoning | STRING | — |