[PR #13] docs(skills): add technique-transparent-subject-compositing recipe #11

Open
opened 2026-10-26 22:33:57 +00:00 by bsakaguchi · 0 comments
Owner

📋 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)

  • 62c78c2 docs(skills): add technique-transparent-subject-compositing recipe
  • 34ec78f docs(skills): distinguish alpha-cutout from see-through, note MaskComposite sizing
  • 4ecfc71 docs(skills): fix MASK slot index and JoinImageWithAlpha inversion
  • 124faad docs(skills): keep GrowMask on the VAEEncodeForInpaint branch, save the source image
  • 7cae722 docs(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 existing skills/technique-combine-people.md: one-line intent sentence, ## Step N sections 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's data/skills.json on its own via the existing daily refresh-skills.yml auto-PR.

The technique- prefix is load-bearing and verified against the server's own filters: mcp-clients.ts MANAGED_COMMAND_PREFIXES copies it as a context file, setup.ts:178/:614 keeps it out of the slash commands, and prompts.ts isPromptSkill (a comfy- 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:

  • Are Steps 1-4 the pipeline as actually run, in that order?
  • Step 3 is the step with the most interpretation in it. The report says "use IPAdapter to inpaint the hole"; I wired that as IPAdapterUnifiedLoader -> IPAdapterAdvanced (with the grown mask as attn_mask) -> InpaintModelConditioning -> KSampler. If the actual graph differed, that section should be corrected to match.
  • Suggested values (IPAdapter weight: 0.8, preset: "PLUS (high strength)", GrowMask expand: 12, opacity 0.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:

  • Every node class named is verified present and non-deprecated in comfy-cloud-mcp-server's bundled data/object_info.json.gz — 30 classes. That snapshot is the cloud's own post-filtered catalog (refresh-object-info.yml sources it from Comfy-Org/cloud@main:services/ingest/data/object_info.json, already run through cloud_disable_config.yaml), so presence in it means cloud-available, not merely upstream-existent.
  • Deprecation was checked explicitly, not just existence — prompted by #12, which is fixing exactly this class of rot in the sibling technique file. This recipe uses GeminiNanoBanana2V2, not the deprecated GeminiNanoBanana2.
  • All six JSON snippets parse, and every input key is a real key for its class_type, with every enum literal (preset, weight_type, combine_embeds, embeds_scaling, operation) a real option for that input.
  • The two load-bearing mechanical claims were checked against ComfyUI source, not asserted from memory: composite() in comfy_extras/nodes_mask.py is mask*source + (1-mask)*destination, a per-pixel linear blend with no binary clamp — which is the entire reason the opacity dial works; and MaskComposite multiply writes only the overlap region and does not resize, which is why an undersized SolidMask silently leaves the subject fully opaque. Both are now stated in the doc.
  • claude plugin validate ./claude-code passes (untouched by this PR).
  • Review-round fixes (from @bigcat88 and CodeRabbit): MASK slot is 1 on SAM3Segment / BiRefNetRMBG; JoinImageWithAlpha gets an InvertMask first; GrowMask stays separate on the VAEEncodeForInpaint branch so attn_mask keeps a MASK; an ImageCompositeMasked paste-back gives a pristine background plate; SolidMask's 1280x720 is marked as a placeholder; Step 5 saves original_image alongside the plate and mask. From @vqt123: the edge-softening advice now blurs the mask (MaskToImage -> ImageBlur -> ImageToMask) instead of using FeatherMask, which only fades from the image borders and leaves a subject's outline untouched (checked in comfy_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.
  • Template 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 that refresh-skills.ts mirrors 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 to claude-code/ — that would be a separate move for both technique files together, not this PR.
  • No slash command added under claude-code/commands/. technique-* files are AI-context recipes, not user-invoked commands, so that is deliberate.
  • One follow-up this PR does not do: setup.ts:609 has a hardcoded techniqueDescriptions map listing only technique-combine-people, so update skills will 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 in comfy-cloud-mcp-server.
  • Suggested numeric values are illustrative — called out above and worth the reporter's correction.

Provenance

Authored by: agent-work loop
Verified:

  • New-file diff vs main: one file, skills/technique-transparent-subject-compositing.md (205 lines); merges cleanly into current main.
  • All six json snippets in the recipe parse as JSON.
  • Node classes, input keys, and enum literals were checked against the cloud object_info catalog, and the composite/MaskComposite/JoinImageWithAlpha/FeatherMask mechanics against ComfyUI source (see Verification above).
  • All review threads are resolved, and the latest commit is approved. The repo has no test suite, linter, or PR CI (its only workflow runs on pushes to main), so no automated checks run on this PR.

Deviations:

  • None from the requested scope. The numeric values are illustrative, and Step 3's wiring is an interpretation; both still need sign-off from the reporter.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/comfy-skills/pull/13 **Author:** [@mattmillerai](https://github.com/mattmillerai) **Created:** 7/31/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `matt/be-5444-transparent-subject-compositing` --- ### 📝 Commits (5) - [`62c78c2`](https://github.com/Comfy-Org/comfy-skills/commit/62c78c27485b5f23fb04fc02e0589822f656ec60) docs(skills): add technique-transparent-subject-compositing recipe - [`34ec78f`](https://github.com/Comfy-Org/comfy-skills/commit/34ec78f66981fe03fe21a66fc8190942ddd3dbf8) docs(skills): distinguish alpha-cutout from see-through, note MaskComposite sizing - [`4ecfc71`](https://github.com/Comfy-Org/comfy-skills/commit/4ecfc71e7d2bafc19d342b52f2ae1ef8699cdf58) docs(skills): fix MASK slot index and JoinImageWithAlpha inversion - [`124faad`](https://github.com/Comfy-Org/comfy-skills/commit/124faad16313933b1a7a29a42c469c2829dd214f) docs(skills): keep GrowMask on the VAEEncodeForInpaint branch, save the source image - [`7cae722`](https://github.com/Comfy-Org/comfy-skills/commit/7cae7226da60b7280dbae729d6849a9cd1c8f199) docs(skills): soften the subject edge with a mask blur, not FeatherMask ### 📊 Changes **1 file changed** (+205 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `skills/technique-transparent-subject-compositing.md` (+205 -0) </details> ### 📄 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 existing `skills/technique-combine-people.md`: one-line intent sentence, `## Step N` sections 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`'s `data/skills.json` on its own via the existing daily `refresh-skills.yml` auto-PR. The `technique-` prefix is load-bearing and verified against the server's own filters: `mcp-clients.ts` `MANAGED_COMMAND_PREFIXES` copies it as a context file, `setup.ts:178`/`:614` keeps it out of the slash commands, and `prompts.ts` `isPromptSkill` (a `comfy-` 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: - Are Steps 1-4 the pipeline as actually run, in that order? - Step 3 is the step with the most interpretation in it. The report says "use IPAdapter to inpaint the hole"; I wired that as `IPAdapterUnifiedLoader` -> `IPAdapterAdvanced` (with the grown mask as `attn_mask`) -> `InpaintModelConditioning` -> `KSampler`. If the actual graph differed, that section should be corrected to match. - Suggested values (IPAdapter `weight: 0.8`, `preset: "PLUS (high strength)"`, `GrowMask expand: 12`, opacity `0.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: - **Every node class named is verified present and non-deprecated** in `comfy-cloud-mcp-server`'s bundled `data/object_info.json.gz` — 30 classes. That snapshot is the cloud's own post-filtered catalog (`refresh-object-info.yml` sources it from `Comfy-Org/cloud@main:services/ingest/data/object_info.json`, already run through `cloud_disable_config.yaml`), so presence in it means cloud-available, not merely upstream-existent. - **Deprecation was checked explicitly, not just existence** — prompted by #12, which is fixing exactly this class of rot in the sibling technique file. This recipe uses `GeminiNanoBanana2V2`, not the deprecated `GeminiNanoBanana2`. - **All six JSON snippets** parse, and every input key is a real key for its `class_type`, with every enum literal (`preset`, `weight_type`, `combine_embeds`, `embeds_scaling`, `operation`) a real option for that input. - **The two load-bearing mechanical claims were checked against ComfyUI source**, not asserted from memory: `composite()` in `comfy_extras/nodes_mask.py` is `mask*source + (1-mask)*destination`, a per-pixel linear blend with no binary clamp — which is the entire reason the opacity dial works; and `MaskComposite` multiply writes only the overlap region and does not resize, which is why an undersized `SolidMask` silently leaves the subject fully opaque. Both are now stated in the doc. - `claude plugin validate ./claude-code` passes (untouched by this PR). - **Review-round fixes** (from @bigcat88 and CodeRabbit): `MASK` slot is 1 on `SAM3Segment` / `BiRefNetRMBG`; `JoinImageWithAlpha` gets an `InvertMask` first; `GrowMask` stays separate on the `VAEEncodeForInpaint` branch so `attn_mask` keeps a `MASK`; an `ImageCompositeMasked` paste-back gives a pristine background plate; `SolidMask`'s `1280x720` is marked as a placeholder; Step 5 saves `original_image` alongside the plate and mask. From @vqt123: the edge-softening advice now blurs the mask (`MaskToImage` -> `ImageBlur` -> `ImageToMask`) instead of using `FeatherMask`, which only fades from the image borders and leaves a subject's outline untouched (checked in `comfy_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. - Template `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 that `refresh-skills.ts` mirrors 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 to `claude-code/` — that would be a separate move for both technique files together, not this PR. - **No slash command added** under `claude-code/commands/`. `technique-*` files are AI-context recipes, not user-invoked commands, so that is deliberate. - **One follow-up this PR does not do:** `setup.ts:609` has a hardcoded `techniqueDescriptions` map listing only `technique-combine-people`, so `update skills` will 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 in `comfy-cloud-mcp-server`. - Suggested numeric values are illustrative — called out above and worth the reporter's correction. ## Provenance **Authored by:** agent-work loop **Verified:** - New-file diff vs `main`: one file, `skills/technique-transparent-subject-compositing.md` (205 lines); merges cleanly into current `main`. - All six ```json``` snippets in the recipe parse as JSON. - Node classes, input keys, and enum literals were checked against the cloud `object_info` catalog, and the composite/MaskComposite/JoinImageWithAlpha/FeatherMask mechanics against ComfyUI source (see Verification above). - All review threads are resolved, and the latest commit is approved. The repo has no test suite, linter, or PR CI (its only workflow runs on pushes to `main`), so no automated checks run on this PR. **Deviations:** - None from the requested scope. The numeric values are illustrative, and Step 3's wiring is an interpretation; both still need sign-off from the reporter. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/comfy-skills#11
No description provided.