Nodes/CrasH Utils/Extract Character Information
ComfyUI Node

Extract Character Information

Pull the character card baked into a PNG

By chrish-slingshot·Created 3 years ago·Updated 29 days ago· 15
Extract Character Information
    • character_data
    path

    Plenty of AI chat tools embed a character's whole persona - name, description, backstory, appearance - directly inside the PNG that serves as their avatar, as hidden text metadata. The picture is quietly also the file. Extract Character Information is a small utility for pulling that data back out so a ComfyUI workflow can use it.

    What it is and why you'd want it

    If you've got a library of character images from a chat tool that uses this embed-in-the-PNG convention, this node lets you reuse that data inside ComfyUI instead of re-typing it - feed a character's backstory into an LLM prompt (this pack's own Query Local LLM pairs naturally here), log which character a batch of generations was for, or just inspect what's actually stored in a card you were handed.

    How it works

    Point it at a PNG file on disk. It reads the embedded text metadata chunks, decodes the base64-encoded character data inside them, and hands it back as a plain string. It's a reader, not a writer - nothing about this node edits or creates that metadata, it only extracts what's already there.

    Inputs and outputs that matter

    One input: path, a plain single-line STRING - the filesystem path to the PNG. Note this is a real difference from most ComfyUI image nodes: it wants a text path, not an IMAGE tensor wired in from a Load Image node. One output: character_data, a STRING containing whatever was decoded.

    Installing it

    ComfyUI Manager: search "CrasH Utils". Manual:

    cd ComfyUI/custom_nodes/
    git clone https://github.com/chrish-slingshot/CrasHUtils.git
    

    Restart ComfyUI. No extra dependencies.

    Common issues

    Wired in an IMAGE and it doesn't work. This node doesn't take image tensors - the input is a text path. If your PNG came from a Load Image node upstream, you need its actual filesystem path as a string, not the loaded image data. Type or paste the path directly, or pull it from wherever you already track your file locations.

    Empty or garbage output. Most likely the PNG simply doesn't have any embedded character metadata - a normal photo or a generic AI render exported without that convention won't have anything to extract. This isn't a bug in the node; the source file just doesn't carry the data.

    Path not found. Double-check you're using the right path format for your OS - Windows backslashes versus Linux/macOS forward slashes trip people up constantly when copy-pasting a path between environments, and a relative path may resolve differently than you expect depending on where ComfyUI's process actually runs from. Use an absolute path if you're unsure.

    Works on some cards, not others. Different tools that embed character data don't all use identical conventions for exactly where and how they store it. If a particular card's export format doesn't match what this node expects, extraction can come back empty even though the file looks similar to ones that do work.

    CategoryCrasH Utils/LLM

    Inputs (1)

    NameTypeDefaultDescription
    pathSTRING

    Outputs (1)

    NameTypeDescription
    character_dataSTRING