Ir para o conteúdo
Node packVerificadoExterno
Fonte aberta

ComfyUI-PixelLock

Pixel-Lock for Qwen-Edit: keep unedited pixels untouched (no drift/rot). Auto-bypass global/style edits. Tested across 374 edits.

Mantenedor@GritAI-LabsC · adoptionnota

Perfil do pacote

Status
Verificado
Publicador
@GritAI-Labs
Fonte
GitHub

README

ComfyUI-PixelLock

Keep Qwen-Edit from touching the pixels you didn't ask it to change.

Qwen-Image-Edit rescales the whole image to ~1MP and redraws it, so a local edit — "change the shirt to red" — also drifts the face and background, and degrades a little more every round you edit. This node composites only the region the edit actually changed back onto your original, at original resolution, so everything you didn't touch is pixel-identical.

It's not a model or a LoRA — it's a tiny, tensor-native post step. Zero dependencies.

Nodes

Pixel Lock Composite — original IMAGE + edited IMAGE → image (locked) + change_mask. Auto-detects the changed region, feathers it, and pastes only that back onto the original.

Global Edit Guard — edit_prompt STRING → bypass BOOLEAN. Some edits should change everything (oil painting, "make it night", replace the background). This reads your edit prompt and returns bypass=True for those, which you wire into Pixel Lock Composite.bypass so the lock steps aside. Without it, style edits get wrongly reverted (see below).

Example graph

Load Image ─► (original) ─────────────────────────►┐
Load Image ─► TextEncodeQwenImageEditPlus ─► KSampler ─► VAEDecode ─► (edited) ─► Pixel Lock Composite ─► Save Image
Edit Prompt ─► Global Edit Guard ─► (bypass) ──────────────────────────────────►┘

Parameters (defaults are validated — see below)

paramdefaultwhat it does
threshold16pixel-diff (0–255) to count as "changed" — lower catches subtler edits
blur3denoise the change map before thresholding
dilate6grow the mask to fully cover the edit
feather4soften the seam
bypassfalsepass the raw edit through (wire Global Edit Guard here)
mask (opt)—supply an explicit edit mask instead of auto-detect

What it's good at — and what it isn't (tested, not guessed)

Validated across a 374-edit sweep (people/objects/scenes/animals × close-up/half/¾/full/wide × front/¾/profile/high/low/back × multiple sizes × multiple seeds) plus multi-round chains:

  • Best at contained local edits — accessories, garment color, small add/remove. On people, edits applied 107/107, and the lock preserved everything else. Strong across every framing (full-body, wide, half, ¾, close-up).
  • Multi-round: it stops the rot. Five rounds of local edits held the unedited pixels at zero drift while the un-locked chain accumulated degradation each round.
  • Global/style edits: use the Guard. Style transfers (oil painting, etc.) have a small pixel-diff but change the whole look, so a naive composite would revert them — the Global Edit Guard bypasses the lock for these. (In testing, ~8% of global edits were wrongly erased without the guard.)
  • Not for whole-subject transforms (recolor an entire object, restyle everything) — those aren't "local," and the node correctly passes them through.

Think of it as a correctness guarantee: unedited pixels stay identical and at full resolution. The payoff is biggest in multi-round and high-res workflows.

Install

Search PixelLock in ComfyUI-Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/GritAI-Labs/ComfyUI-PixelLock

Restart ComfyUI. No dependencies to install.

License

MIT. Built and tested by GritAI.

Nós neste pacote

Nós 2
  • GlobalEditGuard
  • PixelLockComposite

Fontes

3 fontes
GitHubPrimárioVersão master
github.com/GritAI-Labs/ComfyUI-PixelLock

Verificado 5 de nov.

GitHubFonte
github.com/GritAI-Labs/ComfyUI-PixelLock

Verificado 7 de out.

GitHubFonteVersão efa308b63a1fb79b49cd8cb1b9e918c404a3a04b
github.com/GritAI-Labs/ComfyUI-PixelLock

Verificado 3 de out.

Trechos de fonte

2 trechos

Source context: Repo GritAI-Labs/ComfyUI-PixelLock

Source context: Repo GritAI-Labs/ComfyUI-PixelLock