EditUtils: Save Condition lrzjason
Stop re-encoding the same image every run — save the condition once
- condition
Every time you hit Queue in a Qwen-Image-Edit workflow, the expensive part isn't the sampling - it's the encoding. The model's text encoder has to chew your prompt into tokens, and the VAE has to turn your reference image into a latent, all before a single denoising step runs. If you're iterating on the prompt, or just re-running the same edit over and over, you're paying that encoding cost every single run for zero benefit. SaveCondition_EditUtils is the answer: capture the fully-built CONDITIONING once, write it to disk, and let a LoadCondition_EditUtils on the other side skip the whole encoding step.
Mechanically it's dead simple. You feed it a condition (CONDITIONING) and a filename (default condition_tensor), and it torch.saves the conditioning list to ComfyUI/models/conditions/ as a .ckpt file. The directory is created automatically on first use, and it registers itself with ComfyUI's folder system so the load nodes can see it. Filename is basename-only and gets a .ckpt extension appended if you forgot one - the author sanitizes it, so no path-traversal surprises.
A couple of details worth knowing. First, this is an output node (OUTPUT_NODE = True), which means ComfyUI treats it like a Save Image - it always runs, and it's the terminal point you should drag your wires to when you want to cache. Second, and this is the part people miss: what you save is the whole conditioning, reference latents included. This pack's entire trick is that reference latents ride along inside the conditioning dict (the reference_latents key). So saving the conditioning after the encode captures your reference image state too. That's exactly what makes the cache so useful - you can reload the exact reference-aware condition without re-running the VAE.
The workflow the author clearly has in mind: same source image + same system prompt, many different prompts. Save once, then swap in LoadCondition_EditUtils and iterate for free. The one caveat is that your saved condition is tied to the model it was encoded with - a Qwen-Image condition is not a Flux2Klein condition, so don't cross-load between model families and expect it to work.
Install
Part of lrzjason/ComfyUI-EditUtils. ComfyUI Manager → search "ComfyUI-EditUtils", or clone into custom_nodes and restart. No pip dependencies.
Troubleshooting
The main gotcha is forgetting where files land. They go to ComfyUI/models/conditions/, not the output folder - if you're hunting for your .ckpt in the wrong place, that's why. Save silently swallows errors and just prints to the console, so if a file never shows up, check the ComfyUI terminal for an "Error saving condition tensor" line. And if you change your reference image but reuse a saved condition, you'll get the old image's reference - delete the cached file when the source image changes.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| condition | CONDITIONING | — | |
| filename | STRING | condition_tensor | — |
Outputs (0)
No outputs