docs(EmptyQwenImageLayeredLatentImage): explain the layers + 1 slot - #113
docs(EmptyQwenImageLayeredLatentImage): explain the layers + 1 slot#113christian-byrne wants to merge 2 commits into
Conversation
The `layers` widget was documented as "the number of additional layers to add to the latent structure. This defines the depth of the latent representation", which does not tell the reader what the extra slot in `[batch_size, 16, layers + 1, height // 8, width // 8]` actually is. Qwen-Image-Layered regenerates the full image as well as the layers, so slot 0 is the full image and is not one of the layers. It repeats content the user already has and should be discarded when only the layers are wanted. `layers` has min=0, and layers=0 yields that image on its own. Also record the two semantics that are not stated anywhere else: all the layers composited together recreate the full image, and layer order is purely positional (the layers ride the temporal axis of the 5D latent, LatentCutToBatch dim=t moves it into the batch dimension, and there is no z-index field or per-layer metadata anywhere). English source only. Per .cursorrules the other locales are hand maintained and are not translated without an explicit request; a tracking issue follows for the remaining 11.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 18 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe node documentation now identifies Qwen-Image-Layered, documents ChangesQwen-Image-Layered latent documentation
Possibly related issues
Suggested reviewers: 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@comfyui_embedded_docs/docs/EmptyQwenImageLayeredLatentImage/en.md`:
- Line 3: Rewrite the documentation around the Empty Qwen Image Layered Latent
node for non-technical readers using a stack of blank painting sheets as the
central metaphor. Explain that the stack contains one sheet for the complete
image and one for each layer, sheets must stay in order, combining layer sheets
recreates the complete image, and decoded layers include transparency. Remove or
relocate unexplained terms such as latent, tensor, batch, temporal axis, VAE
Decode, z-index, metadata, LatentCutToBatch, and dim=t to technical
documentation if needed.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: b2103fd2-4cdd-4ab9-9891-b6a66a267ad9
📒 Files selected for processing (1)
comfyui_embedded_docs/docs/EmptyQwenImageLayeredLatentImage/en.md
Addresses #113 (comment) review from CodeRabbit: this repo's .cursorrules requires everyday vocabulary and a painting or craft metaphor for a non-technical reader. Reworked around a stack of tracing sheets. Kept every fact, including that the first image is the complete picture and should be discarded, that the layers composite back to it, and that order is positional with nothing recording it. LatentCutToBatch and dim=t stay, moved into Usage suggestions, because without them the reader cannot actually get the layers out.
Addresses #113 (comment) review from CodeRabbit: this repo's .cursorrules requires everyday vocabulary and a painting or craft metaphor for a non-technical reader. Reworked around a stack of tracing sheets. Kept every fact, including that the first image is the complete picture and should be discarded, that the layers composite back to it, and that order is positional with nothing recording it. LatentCutToBatch and dim=t stay, moved into Usage suggestions, because without them the reader cannot actually get the layers out.
720e74b to
70e84e7
Compare
Addresses #113 (comment) review from CodeRabbit: this repo's .cursorrules requires everyday vocabulary and a painting or craft metaphor for a non-technical reader. Reworked around a stack of tracing sheets. Kept every fact, including that the first image is the complete picture and should be discarded, that the layers composite back to it, and that order is positional with nothing recording it. LatentCutToBatch and dim=t stay, moved into Usage suggestions, because without them the reader cannot actually get the layers out.
70e84e7 to
b70ed5d
Compare
|
Heads up on CI: GitHub Actions is in a declared major outage right now (started 15:22 UTC, webhook triggers throttled so push and PR events are not starting workflows). This repo's last Actions run was 2026-08-04, and Practical effect: CLA Assistant has not run, and |
|
recheck |
Problem
EmptyQwenImageLayeredLatentImageallocatestorch.zeros([batch_size, 16, layers + 1, height // 8, width // 8])(comfy_extras/nodes_qwen.py:109-130), and the docs never say what the+ 1is. Thelayersdescription currently reads:That is not just incomplete, it points the reader the wrong way: it suggests the extra slot is structural padding, when it is an actual image the model produces. A core maintainer could not work these semantics out from the code, and nothing in core, on docs.comfy.org, or on the model card states them.
What is actually true
comfyanonymous, on the semantics of this model:
So:
LatentCutToBatchwithdim="t"(comfy_extras/nodes_latent.py:217-256) moves that axis into the batch dimension, after which a layer's z-order is just its index in the batch. There is no z-index field and no per-layer metadata anywhere in the pipeline, so reordering or filtering the batch reorders the layers.layershasmin=0, andlayers=0still yields one image.encoder.conv1.weightis[96, 4, 3, 3, 3], socomfy/sd.py:791setsoutput_channels = 4. Decoded layers carry alpha.Change
English source only, in
comfyui_embedded_docs/docs/EmptyQwenImageLayeredLatentImage/en.md:layersrow so it states thelayers + 1output count and that0is valid.Outputstable, the AI-generated footer and the source fingerprint untouched.Other locales
Not touched, deliberately.
.cursorrulesin this repo says:The other 11 locales (
ar,es,fa,fr,ja,ko,pt-BR,ru,tr,zh,zh-TW) all carry the same wronglayersdescription and need the same fix. Rather than machine-translate them badly, I have filed a tracking issue: #114Related, not fixed here
comfyanonymous also said "our qwen layered template is slightly wrong".
templates/image_qwen_image_layered.jsoninComfy-Org/workflow_templatesrunsEmptyQwenImageLayeredLatentImagewithlayers=2straight intoLatentCutToBatch(dim="t")->VAEDecode->SaveImage, so it saves 3 images and the first is a duplicate of the input. That is a separate repo and a separate fix.