preserving-faces

Compiles a face-locking ComfyUI prompt JSON that re-renders non-face regions at low denoise.

Updated Apr 8, 2026
One-click install
npx skills add https://github.com/ShinyGua/ComfyUI-Agent --skill preserving-faces-shinygua
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: preserving-faces
Source: https://github.com/ShinyGua/ComfyUI-Agent/tree/main/.claude/skills/preserving-faces
Command: npx skills add https://github.com/ShinyGua/ComfyUI-Agent --skill preserving-faces-shinygua

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? When chaining ComfyUI steps like style transfer, inpainting, or background replacement, the subject's face often drifts between steps. This Skill locks the face region by generating a prompt graph that re-renders only the non-face area at very low denoise, keeping facial identity pixel-stable. ## Core Features & Use Cases - Face-region locking: Inverts a supplied face mask with InvertMask and applies it via SetLatentNoiseMask so only non-face pixels are regenerated. - Low-denoise re-render: Defaults the KSampler denoise to 0.25 so surrounding content changes subtly while the face stays untouched. - Composable sub-Skill: Triggered by planner steps with goal=preserve_face, or chained as a seal step after style transfer or inpainting; output can feed downstream steps or the evaluating-identity-preservation evaluator. - Use Case: After replacing a portrait's background, run this Skill with the original image and face mask to restore any facial drift while keeping the new background. ## Quick Start Ask the agent to preserve the face in the current image using the provided face mask while re-rendering the rest of the scene at low denoise.

Frequently Asked Questions about preserving-faces

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I keep the same face in ComfyUI after inpainting or style transfer?▼

Provide the previous step's image plus a face mask, and this Skill compiles a prompt that inverts the mask and re-renders only the non-face region at 0.25 denoise. The face area stays pixel-stable while the rest of the image updates.

How does face preservation with masks work in ComfyUI?▼

The workflow loads the image and face mask, inverts the mask with InvertMask, encodes the image to latents, and applies SetLatentNoiseMask so the KSampler only denoises outside the face. A low denoise value limits changes to the unmasked region.

What denoise value should I use to preserve a face in Stable Diffusion?▼

This Skill defaults to 0.25 denoise, which is low enough to keep composition stable while refreshing non-face content. You can override it through the params.denoise field, but higher values risk altering identity-adjacent details.

Can I override the checkpoint, seed, or sampler settings?▼

Yes. The compile script accepts model.checkpoint, params.seed, steps, cfg, sampler_name, scheduler, and denoise, plus prompt and negative_prompt text. A negative seed value is replaced with a time-based random seed.

What happens if the planner goal is not preserve_face?▼

The compile script rejects any VIO whose goal is set to something other than preserve_face, exiting with a non-zero code and a JSON error object. Requests without a goal field are still accepted.