Drop the duplicate first image from the Qwen-Image-Layered blueprint - #15364
Drop the duplicate first image from the Qwen-Image-Layered blueprint#15364christian-byrne wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📜 Recent review details⏰ Context from checks skipped due to timeout. (14)
🧰 Additional context used📓 Path-based instructions (4)**/*📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{py,json}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{py,md,txt,json}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**⚙️ CodeRabbit configuration file
Files:
🧠 Learnings (1)📚 Learning: 2026-05-10T17:25:49.999ZApplied to files:
🔇 Additional comments (1)
📝 WalkthroughWalkthroughThe blueprint adds a 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
|
CI note: no GitHub Actions workflows have run on this PR yet. GitHub has had an Actions incident open since 2026-08-06 15:22 UTC — "Webhook triggers remain throttled to aid recovery, so many push and pull request events are not triggering new workflow runs." Other PRs opened in the same window show the same empty check list. I'll re-trigger and drive the checks to green once Actions recovers. |
EmptyQwenImageLayeredLatentImage allocates layers + 1 temporal slots and slot 0 is the model's regenerated copy of the original image, not a layer. The blueprint splits the whole temporal axis into a batch and decodes all of it, so asking for 2 layers returns 3 images. Insert LatentCut(dim=t, index=1, amount=16384) between KSampler and LatentCutToBatch so the redundant slot is dropped in latent space rather than VAE-decoded and shown. Comfy-Org/workflow_templates carries an independent copy of this same blueprint; it is patched identically in a companion PR.
b486176 to
c532115
Compare
|
This lgtm, @comfyui-wiki I'd like to confirm with you it's ok to merge? |
|
Already tested, LGTM @alexisrolland |
The bug
EmptyQwenImageLayeredLatentImageallocateslayers + 1temporal slots:Slot
0is the model's regenerated copy of the original image, not a layer.The
Image to Layers(Qwen-Image-Layered)blueprint feeds the sampler output straight intoLatentCutToBatch(dim="t", slice_size=1), which reshapes the entire temporal axis into the batch dimension, and decodes all of it. Nothing drops the redundant frame, so asking for 2 layers returns 3 images with no indication that the first is a duplicate.Confirmed by comfyanonymous:
The fix
Insert a
LatentCut(dim="t", index=1, amount=16384)betweenKSamplerandLatentCutToBatch:LatentCutalready exists (comfy_extras/nodes_latent.py:175-215, added in #9609) and predatesLatentCutToBatch(#11411), which this blueprint already uses. No node changes.Cutting in latent space rather than adding an
ImageFromBatchafterVAEDecodeavoids a full-canvas VAE decode that would immediately be discarded.amountisMAX_RESOLUTIONbecauseLatentCutclamps it to what exists (nodes_latent.py:209), so it reads as "everything from index 1 onward" for anylayersvalue, andlayers = 0still degrades correctly to the single original image — wiring the subgraph'slayersinput intoamountinstead would fail validation atlayers = 0, since the widget's minimum is 1.Effect
layersCorrect under
batch_size > 1as well: withlayers=3, batch_size=2the output goes from 8 images ([0,1,2,3,0,1,2,3]) to 6 ([1,2,3,1,2,3]).What changed
One file:
blueprints/Image to Layers(Qwen-Image-Layered).json— one new node, one new link, one re-targeted link, plus thelastNodeId/lastLinkIdcounters. No existing node moved or resized; the new node takes the next freeordervalue so the subgraph keeps its contiguous uniqueordersequence.This blueprint is duplicated across two repos, and nothing keeps them in sync
Worth stating plainly, because it is the reason this PR exists separately at all:
Comfy-Org/ComfyUIandComfy-Org/workflow_templates. No workflow, bot, script or CI check in either repo compares them.workflow_templates'scripts/blueprints/import_blueprints.py --sourceis a manual, opt-in copy from an arbitrary local directory and has no knowledge of this repo. Both copies are hand-committed by humans in ordinary feature PRs, which is the only reason they have stayed identical so far.app/subgraph_manager.py:98globs<ComfyUI>/blueprints/*.json, with noimportlib.resourceslookup, nofolder_pathsindirection and no fallback. And althoughrequirements.txt:2pinscomfyui-workflow-templates==0.11.31, that meta package does not depend oncomfyui-subgraph-blueprints, sopip install -r requirements.txtinstalls the blueprint manifest metadata but not a single blueprint JSON asset.workflow_templatesalone would not fix anything for users, and patching this alone would not fix the PyPI/cloud consumers. Both must land.Filed as #15363 so the duplication is tracked independently of this bug.
Companion PR
Comfy-Org/workflow_templatescarries an independent copy of this blueprint atblueprints/image_to_layers_qwen_image_layered.json(plus the generated mirror underpackages/blueprints/), and the two shipped templates that have the same bug. Patched in Comfy-Org/workflow_templates#1092. Land both together or the copies drift.Also outstanding over there: the template gallery thumbnails still show the duplicate and need re-shooting by someone with the weights.