DOGMA Image After Text — VRAM Barrier
DOGMA Image After Text
- image
- image
The node does nothing. It takes an image and returns it. Its entire purpose is to have a text input, so ComfyUI is forced to finish the language model before it starts the upscale.
If you have ever had a workflow OOM at the exact moment the VLM was supposed to be planning, this is the fix, and it's about four lines long.
Why you'd need it
ComfyUI executes a graph by working backwards from the output nodes, running each node once its inputs exist. Nodes that don't feed each other are effectively independent - the scheduler is free to run them, and free to have their models resident simultaneously. In a DOGMA restoration graph that's a problem specific to VRAM: the planner wants a Qwen3-VL loaded, and the re-render branch wants FLUX.2 Klein loaded, and on a 12–16GB card those two do not coexist happily. Add a SAM segmenter in the middle and you've got three models that would all like to be resident at once.
The usual remedies are unload calls inside nodes (the pack's cleanup nodes do that) or a boolean that switches branches off. This is the cheaper, dumber remedy: manufacture a dependency so the engine can't overlap the two branches.
How it works
dependency is declared as an IMAGE-free STRING input with forceInput: True. That flag is the mechanism. It means the socket exists but has no widget - you cannot type a value into it, you must connect something that produces a STRING. So you wire your planner's output (or its info / preview string, or the preview output of a VLM barrier node) into dependency, and image passes through untouched.
The node's function does nothing with dependency except accept it. That's fine. The side effect is the point: the engine now has a hard ordering edge from the text-producing branch to whatever consumes this image, so the text branch runs first, and if the downstream node is the heavy one, the planner has finished and had a chance to unload before the upscale starts.
It also happens to make graphs readable. A wire that says "this image waits for that text" is a comment the engine respects.
Inputs and outputs
Two inputs, both required. image (IMAGE) - the thing you want to delay. dependency (STRING, forced input) - the thing that must happen first. Note that you cannot leave dependency empty or type a placeholder into it; the input is forced precisely so there's nothing to type.
One output, image (IMAGE), identical to what came in. No mask, no string, no info. Nothing to misread.
Install
ComfyUI Manager → search DOGMA Nodes (publisher axior), install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/axior/ComfyUI-DOGMA-Nodes
# restart ComfyUI
No external dependencies of any kind - the pack's requirements.txt is one comment line - and no model files. This particular node has no imports beyond what ComfyUI already loads.
Common issues
Be honest about what this does and doesn't buy you. It orders two branches; it does not unload anything. If you're still tight on VRAM after wiring it, the models are still both alive because nothing told them to go away - pair it with DOGMAImageVRAMCleanupV14 (or a VLM barrier node, which unloads as part of its job) placed after the text branch, before the heavy one.
The other thing: a forced-input socket can't be satisfied by a text widget, so if all you have upstream is a note or a text node, check that it actually outputs STRING. And since the whole effect is invisible on a machine with VRAM to spare, don't expect the graph to look or behave differently on a 24GB card - no error, no log line, just one fewer overlapping load.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| dependency | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |