Pet Companion Nodes
Green-screen cleanup, chroma keying, despill, and exact closed-loop transparent WebP export nodes for ComfyUI.
Nodes (3)
Why Your AI Pet Loop Comes Out With a Green Halo (and How This Node Kills It)
Pet loop, keyed, seamless, and saved — one node does the boring part
Your pet's video starts ugly. Make the first frame actually green.
ComfyUI Pet Companion Nodes
Production-oriented green-screen and transparent-loop utilities for real-pet companion animations.
Nodes
Pet / Normalize Green First Frame
Replaces only background regions connected to the canvas boundary with an exact chroma color. This helps retain dark noses, pupils, coat markings, and interior colors while cleaning irregular generated backdrops and negative spaces around separated legs.
Pet / Chroma Key + Closed Loop WebP
Processes an IMAGE batch as a video sequence:
- edge-connected chroma keying;
- soft matte generation;
- local green-spill suppression;
- optional exact endpoint closure by replacing the last frame with the first;
- lossless animated RGBA WebP export;
- checkerboard preview, foreground mask, and saved output path.
Pet / Chroma Key + Transparent GIF
Exports a transparent animated GIF and can automatically crop the entire animation around the union of all foreground pixels. The crop is calculated once for the complete sequence, padded, and made square, so the pet does not jump or resize between frames. Recommended product setting:
auto_crop_square: enabledpadding_percent:3.5(measured against the union of all animation frames)
Each action may produce a different pixel resolution, but every result remains 1:1 and keeps a stable canvas throughout the animation. Clients should scale the complete GIF into the widget box without applying an additional crop.
Installation
Install from ComfyUI Manager/Registry, or clone into ComfyUI/custom_nodes:
git clone https://github.com/GuardSkill/ComfyUI-Pet-Companion-Nodes.git
Restart ComfyUI after installation. The nodes appear under Pet Companion/Green Screen.
Typical workflow
Pet photo
-> identity-preserving image edit on solid #00FF00
-> Pet / Normalize Green First Frame
-> image-to-video model
-> Pet / Chroma Key + Closed Loop WebP
Recommended starting values for H3 green-screen output at 24 fps:
- key color:
#00FF00 - similarity:
0.20 - smoothness:
0.10 - despill:
0.85 - close loop: enabled
- lossless: enabled
Notes
- The keyer intentionally starts from regions connected to the frame boundary, reducing accidental removal of similar colors inside the subject.
- Exact closure changes only the final exported frame; interior generated frames are retained.
- The node writes animated WebP files under the configured ComfyUI output directory.
License
MIT