SDXL ChordEdit (MODEL/CLIP/VAE)
SDXL ChordEdit, actually explained
- model
- clip
- vae
- image
- image
- latent
ComfySDXLChordEdit (displayed as "SDXL ChordEdit (MODEL/CLIP/VAE)") is a text-driven image editor that replaces the usual img2img guessing game with one idea: whatever direction separates two prompts in the model's conditioning space is the direction your image should move. Feed it a photo, tell it the source prompt is "a photo of a person" and the target is "a watercolor painting of a person", and it walks the image's latent toward that change. No KSampler, no denoise slider, no separate Conditioning Set Area nodes - one node takes MODEL, CLIP, VAE, an image, and two sentences, and hands you the edited image plus the latent.
It's from the Fengxiaoxiao-001/ComfyUI-FastTool pack ("XiaoXiao" is the author's handle, and it's in the XiaoXiao/ChordEdit category). This is the research-y corner of an otherwise VRAM-focused toolkit, and it's honestly a niche tool. "ChordEdit" has essentially no community footprint on Reddit - this is a small author's take on the chord/direction-editing family of methods, not a household name like InstructPix2Pix. If you're comfortable tuning a KSampler you may not need it. But it is genuinely one-node-simple for prompt-consistent edits, which is rare.
How it actually works
The node encodes your image into SDXL latent space with proper crop conditioning, encodes both prompts, and computes the edit direction: the difference between the target and source conditioning (both cross-attention and pooled output). That's the chord - two prompt points, one direction.
The direction is noisy, so it estimates it the Monte Carlo way. It creates noise_samples random noises (seeded), and at each step from t_start (default 0.85) down to t_end (default 0.15) it runs the UNet on each noise at two nearby noise levels (t and t - t_delta), each under both the source and target prompts. That's four model inputs per noise per step - which is exactly what the unet_batch_size tooltip means by "each noise generates four sets of model inputs". The averaged difference gets scaled by direction_gain and step_scale, then added to the latent, step by step.
The inputs that matter
You will actually set most of these, but a few carry the tuning weight:
source_prompt/target_prompt- the two ends of the edit. Keep them structurally similar ("a photo of a person" → "a watercolor painting of a person"); if they're identical the node raises an error because there's no direction to walk.noise_samples(default 4) - more samples = smoother, less noisy direction, but 4 UNet passes per sample per step. This is where the VRAM and time go.direction_gain(default 2.0) - the tooltip is the author's own advice: 1.0 is the original formula, but SDXL works better from 2.0. Turn it up if the edit is too weak, down if it overshoots.step_scale(default 0.35) - how far each step pushes along the direction.n_steps,t_start,t_end,t_delta- the sampling window. The defaults (8 steps, 0.85→0.15) are a sane starting point.width/height(default 1024×1024, SDXL native) withcenter_cropandforce_square_when_croppingon by default - the latter forces a square target to match the original ChordEdit preprocessing, so leave it unless you have a reason not to.
Outputs are image (the edited result, decoded) and latent - wire the latent into a KSampler if you want to push the edit further, or just save the image.
Install
Install the pack once; that covers every node in it. ComfyUI Manager: search "FastTool". Or:
cd ComfyUI/custom_nodes
git clone https://github.com/Fengxiaoxiao-001/ComfyUI-FastTool.git
Then restart ComfyUI. No Python dependencies - pyproject.toml declares none; it builds on ComfyUI's own comfy.samplers, comfy.model_management, and SDXL VAE code.
Where people get burned
- It's VRAM-heavy by construction. Four UNet inputs per noise per step adds up fast. If you OOM, drop
unet_batch_sizeto 1 first, thennoise_samples, thenn_steps. There's also aclear_cache_after_runtoggle (default off) that frees the cache when the node finishes. - It's SDXL-only. The conditioning uses SDXL's crop-coordinate encoding; don't feed it an SD1.5 or Flux setup and expect it to work.
- Empty or near-identical prompts log a warning (or raise, if identical). Give both prompts real content - the edit direction is the difference between them.
- The pack README describes more nodes than the current build registers (the VRAM CLIP Offloader it advertises is commented out in
__init__.py). Trust what shows up in your node search, not the README.
Inputs (21)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| clip | CLIP | — | |
| vae | VAE | — | |
| image | IMAGE | — | |
| source_prompt | STRING | a photo of a person | — |
| target_prompt | STRING | a watercolor painting of a person | — |
| seed | INT | 420–9223372036854776000 | — |
| noise_samples | INT | 41–32 | — |
| n_steps | INT | 81–100 | — |
| t_start | FLOAT | 0.850–1 | — |
| t_end | FLOAT | 0.150–1 | — |
| t_delta | FLOAT | 0.0500–1 | — |
| step_scale | FLOAT | 0.35-10–10 | — |
| direction_gain | FLOAT | 2.00–20 | 放大 source/target 的编辑方向。1.0 为原始公式;SDXL 建议从 2.0 开始。 |
| cleanup | BOOLEAN | false | — |
| width | INT | 1024256–4096 | — |
| height | INT | 1024256–4096 | — |
| center_crop | BOOLEAN | true | — |
| force_square_when_cropping | BOOLEAN | true | 启用中心裁剪时,强制使用正方形目标尺寸,以匹配原始 ChordEdit 预处理。 |
| unet_batch_size | INT | 11–8 | 一次批量处理多少个噪声样本。每个噪声会生成四组模型输入。 |
| clear_cache_after_run | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| latent | LATENT | — |