Nodes/comfyui-game-assets-maker/Aseprite Apply VLM Correction
ComfyUI Node

Aseprite Apply VLM Correction

The node that takes the VLM's word and fixes your atlas

By quinteroac·Created 4 months ago·Updated 4 months ago· 21
Aseprite Apply VLM Correction
  • spritesheet
  • corrected_aseprite_json
  • json_path
  • report
aseprite_json
vlm_response
image_index0
save_jsontrue
filename_prefixaseprite_vlm_corrected

Aseprite VLM Audit Prompt writes the ask; this node applies the answer. GameAssets_AsepriteApplyVLMCorrection takes your original atlas, the VLM's JSON response, and the spritesheet, then returns a corrected Aseprite JSON with sane frame rectangles. If you're automating sprite QA with a vision model, this is the half of the loop that does the actual work.

It's from comfyui-game-assets-maker, the pack shared on r/comfyui for GPT Image 2 sprite pipelines - and it's more forgiving than you'd expect from prototype code. It accepts the VLM response in two shapes: a list of frame rectangles, or a full frames object. It clamps every rectangle to the real image size so a hallucinated coordinate that goes off the edge gets pulled back instead of erroring. It keeps existing frame names when possible, updates meta.size to match the actual image, and works on both visual-novel and animation atlases.

How it works

Connect spritesheet (the IMAGE, so the node knows the true dimensions), aseprite_json (the original atlas), and vlm_response (the text your VLM returned). The node parses the response, applies the corrected rectangles, and returns the fixed JSON. image_index picks the sheet if you're batching, and save_json + filename_prefix control whether a copy lands in ComfyUI's output directory.

The report output is the part worth reading: how many frames changed, which ones, and any notes the VLM embedded. If a model flagged five frames and it changed zero, your response shape is probably wrong.

The full loop

Aseprite atlas → VLM Audit Prompt → [your VLM node] → Apply VLM Correction → corrected JSON

The audit node hands you the prompt and image; your VLM produces the text; this node applies it. You can also hand-feed vlm_response from a text node if you want to iterate on the coordinates yourself.

Installing

ComfyUI Manager (search "comfyui-game-assets-maker") or:

cd ComfyUI/custom_nodes
git clone https://github.com/quinteroac/ComfyUI-GameAssetsMaker.git
cd ComfyUI-GameAssetsMaker
pip install -r requirements.txt

Restart after. The only dependency is opencv-python; the VLM is entirely your own choice and runs outside this pack.

Where people get burned

The weak link is the VLM's output, not this node. A response wrapped in markdown code fences, or prose with numbers buried in sentences, won't parse cleanly - the audit prompt tries to prevent that, but a chatty model can still ruin it. Check the report for frames changed: 0 when you expected changes; that's the tell that your VLM response didn't match the expected schema. And keep the sheet size honest: the clamp protects you, but it can't fix a sheet that's genuinely smaller than your atlas assumed.

CategoryGame Assets/Aseprite

Inputs (6)

NameTypeDefaultDescription
spritesheetIMAGE
aseprite_jsonSTRING
vlm_responseSTRING
image_indexINT00–4096
save_jsonBOOLEANtrue
filename_prefixSTRINGaseprite_vlm_corrected

Outputs (3)

NameTypeDescription
corrected_aseprite_jsonSTRING
json_pathSTRING
reportSTRING