mirror of
https://github.com/Comfy-Org/comfy-skills.git
synced 2026-11-04 23:37:45 +00:00
[PR #13] docs(skills): add technique-transparent-subject-compositing recipe #11
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-skills#11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/comfy-skills/pull/13
Author: @mattmillerai
Created: 7/31/2026
Status: 🔄 Open
Base:
main← Head:matt/be-5444-transparent-subject-compositing📝 Commits (5)
62c78c2docs(skills): add technique-transparent-subject-compositing recipe34ec78fdocs(skills): distinguish alpha-cutout from see-through, note MaskComposite sizing4ecfc71docs(skills): fix MASK slot index and JoinImageWithAlpha inversion124faaddocs(skills): keep GrowMask on the VAEEncodeForInpaint branch, save the source image7cae722docs(skills): soften the subject edge with a mask blur, not FeatherMask📊 Changes
1 file changed (+205 additions, -0 deletions)
View changed files
➕
skills/technique-transparent-subject-compositing.md(+205 -0)📄 Description
ELI5
Someone asked for a character you can see through — a ghost standing in a room, with the room visible behind them. Prompting for "semi-transparent" doesn't work: the model treats it as a vibe, and you get a different amount of see-through every seed with no way to adjust it afterwards. Generating the character on its own and pasting it over a background doesn't work either — the lighting and perspective never match, so it reads as a sticker.
The trick that does work: generate the character and the room together in one image (so they agree on lighting and perspective), cut the character out, use IPAdapter to paint the room back in behind where they were standing, then paste the character back on top at whatever opacity you like. Because you now hold two separate layers, opacity is just a number you set.
This PR writes that recipe down so the assistant can follow it step by step.
What this is
skills/technique-transparent-subject-compositing.md— a transcription of the pipeline reported as actually working, matching the structure and voice of the existingskills/technique-combine-people.md: one-line intent sentence,## Step Nsections with concrete node names and JSON snippets, an options table, and a closing## Key learnings.Doc-only, one new file, 205 lines. No server changes. Content reaches
comfy-cloud-mcp-server'sdata/skills.jsonon its own via the existing dailyrefresh-skills.ymlauto-PR.The
technique-prefix is load-bearing and verified against the server's own filters:mcp-clients.tsMANAGED_COMMAND_PREFIXEScopies it as a context file,setup.ts:178/:614keeps it out of the slash commands, andprompts.tsisPromptSkill(acomfy-prefix test) keeps it out of MCP prompt registration.Review requested from the technique's author and the creative team
I could not resolve a GitHub handle for Sanghoon RHO among the visible Comfy-Org members, so I did not guess at a reviewer request — please add them (or the right creative-team reviewer) directly.
Please do not merge on bot review alone. This is domain content, and the reporter is the ground truth — Sanghoon RHO reported the working pipeline, and I transcribed it rather than deriving it. What I'd most like checked:
IPAdapterUnifiedLoader->IPAdapterAdvanced(with the grown mask asattn_mask) ->InpaintModelConditioning->KSampler. If the actual graph differed, that section should be corrected to match.weight: 0.8,preset: "PLUS (high strength)",GrowMask expand: 12, opacity0.45) are illustrative starting points, not reported measurements. Real numbers from the spike would be better.Verification
No test suite or linter in this repo, so verification is against the catalog and the consuming code:
comfy-cloud-mcp-server's bundleddata/object_info.json.gz— 30 classes. That snapshot is the cloud's own post-filtered catalog (refresh-object-info.ymlsources it fromComfy-Org/cloud@main:services/ingest/data/object_info.json, already run throughcloud_disable_config.yaml), so presence in it means cloud-available, not merely upstream-existent.GeminiNanoBanana2V2, not the deprecatedGeminiNanoBanana2.class_type, with every enum literal (preset,weight_type,combine_embeds,embeds_scaling,operation) a real option for that input.composite()incomfy_extras/nodes_mask.pyismask*source + (1-mask)*destination, a per-pixel linear blend with no binary clamp — which is the entire reason the opacity dial works; andMaskCompositemultiply writes only the overlap region and does not resize, which is why an undersizedSolidMasksilently leaves the subject fully opaque. Both are now stated in the doc.claude plugin validate ./claude-codepasses (untouched by this PR).MASKslot is 1 onSAM3Segment/BiRefNetRMBG;JoinImageWithAlphagets anInvertMaskfirst;GrowMaskstays separate on theVAEEncodeForInpaintbranch soattn_maskkeeps aMASK; anImageCompositeMaskedpaste-back gives a pristine background plate;SolidMask's1280x720is marked as a placeholder; Step 5 savesoriginal_imagealongside the plate and mask. From @vqt123: the edge-softening advice now blurs the mask (MaskToImage->ImageBlur->ImageToMask) instead of usingFeatherMask, which only fades from the image borders and leaves a subject's outline untouched (checked incomfy_extras/nodes_mask.py).Negative-claim falsification
The doc asserts a negative ("prompting alone cannot control transparency"), so I went looking for a path that would falsify it rather than only asserting it. Two turned up in the bundled catalog and templates:
LayeredDiffusionApply/LayeredDiffusionDecodeRGBA(the Layer Diffuse family) — available on cloud, generates genuinely transparent RGBA natively.video_wan2.1_alpha_t2v_14B— "alpha channel support for transparent backgrounds and semi-transparent" video.Neither solves the reported problem: both produce a subject on a transparent background (an alpha cutout with no scene), which is the "generated separately" failure mode this recipe exists to avoid — there is still nothing reconstructed behind the subject to show through. So the recipe stands, but I added an explicit fork at the top routing the alpha-cutout ask to Layer Diffuse and a
search_templates-first instruction, rather than leaving a reader to infer that no native-transparency node exists. The doc redirects; it does not dead-end.Judgment calls
skills/is marked legacy in the README ("frozen; will be removed once that installer fully retires"), but it remains the single source of truth thatrefresh-skills.tsmirrors into the server, and it is where the sibling technique file lives. Adding here per the ticket. Flagging in case the technique surface is meant to migrate toclaude-code/— that would be a separate move for both technique files together, not this PR.claude-code/commands/.technique-*files are AI-context recipes, not user-invoked commands, so that is deliberate.setup.ts:609has a hardcodedtechniqueDescriptionsmap listing onlytechnique-combine-people, soupdate skillswill list this file with an empty description until a one-line entry is added there. That is a server change and out of scope per the ticket; worth a follow-up incomfy-cloud-mcp-server.Provenance
Authored by: agent-work loop
Verified:
main: one file,skills/technique-transparent-subject-compositing.md(205 lines); merges cleanly into currentmain.jsonsnippets in the recipe parse as JSON.object_infocatalog, and the composite/MaskComposite/JoinImageWithAlpha/FeatherMask mechanics against ComfyUI source (see Verification above).main), so no automated checks run on this PR.Deviations:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.