DOGMA ChunkPrompt v56.6
Deleting half your VLM's caption on purpose
- prompt
Hand this node a caption and it will hand you back a shorter one. That's not a bug or a pruning pass you forgot to configure - it's the entire point, and it's the most opinionated little filter in the pack.
The problem it's solving
The DOGMA phase-3 loop works like this: a SAM search finds instances of a category in your image, each one gets cropped, an image pass re-renders the crop at a resolution the model can spend pixels on, and the result is stitched back. The re-render needs a prompt for the crop, so the workflow asks a VLM what's actually in that crop.
The trouble is what a VLM hands back. Ask a chat model to describe a photograph and you get chat: a thinking block if it reasons, a lead-in like Caption:, markdown backticks, and - worst of all - instructions. "Preserve the building geometry. Refine the facade detail. Do not add new windows." Those read like helpful guidance to you and like sampler commands to a diffusion model, which is a known way to get a tile that argues with its own reference. The KB's captioning section has the same complaint from the dataset side: a captioner's job is to describe, and the moment it starts advising, you've lost control of what it's actually saying.
So ChunkPrompt keeps the declarative sentences and throws the rest away.
How it works
The cleanup, in the author's order:
- strips any
<think>...</think>block entirely; - strips a leading
Caption:,Description:orScene:label; - strips backticks and whitespace from the edges;
- splits the rest into sentences on
.!?or newlines; - drops every sentence that starts with an imperative verb - preserve, keep, refine, restore, enhance, improve, repair, remove, add, avoid, maintain, retain, recover, change, replace, use, with optional "please/only/always/never/do not" in front;
- joins what's left and appends a fixed detail tail: "Natural photographic detail, clearly resolved material texture, balanced tonal transitions and restrained local contrast."
Then it does the same cleanup on your project_context and joins the two, so the context string gets the same protection from stray commands.
If fewer than four words survive, it raises: DOGMA: missing factual crop caption. Check the Qwen output before sampling. That's the node telling you your VLM returned nothing useful rather than silently sampling with an empty prompt.
Inputs and outputs
- caption - the per-crop description from your VLM. Normally comes from a caption node fed by the DOGMA caption instruction (see
DOGMADenoiseCategoryV566), not typed by hand. - project_context - the shot-level string: style, location, era, whatever context should apply to every crop.
Output is a single prompt STRING. Wire it into the positive conditioning of the masked latent pass - in the reference workflow that's DOGMAMaskedDenoiseLatentV566 plus whatever sampler then runs the crop.
Neither input is optional and both are forceInput, so this is a wire-it-up node, not a widget node. You're not supposed to edit captions here; if you want a different caption, change what the VLM is asked for.
Install
Same pack, same drill:
comfy node install comfyui-dogma-nodes
# or
cd ComfyUI/custom_nodes
git clone https://github.com/axior/ComfyUI-DOGMA-Nodes
pip install -r ComfyUI-DOGMA-Nodes/requirements.txt
Then restart ComfyUI. The README claims no extra Python dependencies, but requirements.txt ships scipy>=1.10 and the v56.6 modules import scipy.ndimage - so let the Manager run the requirements (or run the pip line) or you'll hit a ModuleNotFoundError on load. Nothing else is downloaded: no models, no LoRAs, and the captioning VLM is whatever you already run.
Gotchas
The filter is blunt about sentence position. A sentence starting with "Keep" is gone even if it was the only sentence describing the subject, and a descriptive sentence that happens to start with "Use" is gone too. If your crops are coming back under-described and you can't see why, log the caption before and after this node - the difference is usually obvious.
Second, this isn't a prompt enhancer. It never adds subject detail; it only removes noise and appends the same generic detail tail for every crop. Category-specific wording belongs upstream in the caption instruction, which is why the author's v56.6 pass deliberately has "no fixed category edit prompt".
Third: because the node raises rather than falling back, a refusal from your VLM ("I can't describe this image") collapses to a hard stop mid-run. That's cheap to diagnose - the caption is right there in the error message - but it does mean your first batch run will die at image 30 of 40 if one crop trips it. Trim the batch or fix the caption instruction before you leave it unattended.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| caption | STRING | — | |
| project_context | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |