Game SD Asset Finalize
Turn a cutout character into a game-ready canvas
- image
- image
- alpha_mask
You've generated a chibi character, cut it out of its background, and now you need the thing to sit on a transparent canvas of exactly 1024x1024, centered, with its feet planted near the bottom. Doing that by hand for twenty emotion variants is miserable. Game SD Asset Finalize is the pack's finishing step that does exactly that boring, repeatable layout work for you.
What it actually does
It takes a generated character image and normalizes it onto a fixed canvas. For each frame in the input batch it: crops to the opaque subject (based on the image's alpha channel), adds your padding, scales to fit the canvas, centers horizontally, and bottom-aligns with a configurable margin. The result is a transparent RGBA image and a matching alpha mask - precisely the shape game engines and sprite sheets want, where every character occupies the same footprint no matter which pose or emotion you generated.
It's worth being blunt about what it is not. The name sounds like a full pipeline, but this node does no background removal. The README spells it out: no RMBG, no SAM, no BiRefNet, no external model calls at all. It assumes the background is already gone and you're handing it an image with real alpha. That's the single most important thing to understand before you wire it up.
How it works
Under the hood it's plain PIL/torch math, no ML. The node builds a mask from the input's alpha channel (pixels where alpha > alpha_threshold, default 8), takes the bounding box of that mask, expands it by padding, and crops. If your image has no alpha channel or is fully opaque, it treats the whole frame as the subject - meaning no crop happens and you just get a centered, resized image. Then it scales down (never up) to fit inside canvas_width - 2*padding by canvas_height - bottom_margin, and composites onto a transparent canvas. Scale is capped at 1.0, so a small 512px render will not be blown up to fill a 1024 canvas - run your own upscaler first if you want that.
The inputs that matter for a beginner:
image- the only required input. Wire your generated image here, through a background-removal node first.canvas_width/canvas_height- your target canvas, defaults to 1024x1024, step 8 (multiple of 8 keeps VAE-friendly dimensions if you re-encode).padding(default 48) andbottom_margin(default 32) - breathing room around the subject and how far its feet sit from the canvas bottom. These two are what you'll fiddle with to get the framing consistent across a whole character set.alpha_threshold- how strict the "is this transparent" test is. Leave it at 8 unless you see stray halos or holes eating into soft edges.
Outputs are image (the RGBA result, wire into Save Image) and alpha_mask (the same alpha as a MASK, if whatever you're saving through takes one).
Installing it
The pack is tiny and has no dependencies beyond what ComfyUI already ships - no requirements.txt, no model downloads. It deliberately includes no checkpoints, LoRAs, or IP-Adapter weights; you bring those from your existing workflow.
Via ComfyUI Manager: search "comfyui-game-sd-character-pack" and install, then restart ComfyUI.
Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/hyyyein/comfyui-game-sd-character-pack
# restart ComfyUI
The README suggests naming the folder game_sd_character_pack - keep that in mind if you're copying rather than cloning. All three nodes show up under "Game SD Character".
Common issues
- You get a full rectangle instead of a cropped character. You skipped background removal. The image has no usable alpha, so there's nothing to crop to. Put an RMBG/BiRefNet/inSPyReNet node upstream.
- The output looks tiny on the canvas. It never upscales, by design. Upscale before Finalize, or bump your generation resolution.
- Ragged edges around the character. The
alpha_thresholdcrop and a binary alpha mask can bite on flyaway hair - that's a matting-vs-segmentation problem, and the fix is a better removal model upstream, not this node. - Batch mode: it processes every frame in the input batch, so a batch of emotions all come out the same size, which is exactly what you want for a sprite sheet.
One honest note: this is a brand-new, zero-footprint pack (you're likely one of the first people to run it). What's here works, but don't expect a wall of community war stories yet. It's a small, sensible tool for a small, specific job.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| canvas_width | INT | 1024128–4096 | — |
| canvas_height | INT | 1024128–4096 | — |
| padding | INT | 480–512 | — |
| bottom_margin | INT | 320–512 | — |
| alpha_thresholdopt | INT | 80–255 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| alpha_mask | MASK | — |