ComfyUI Node

项目素材库 - Star7

The boring node that makes @-references work

By star7code·Created 17 days ago·Updated 11 days ago· 7
项目素材库 - Star7
    • 素材库
    ◄library_json{"assets":[]}►

    It looks like nothing. It isn't.

    项目素材库 - Star7 (Star7DirectorLibrary) has one required input, one output, and no visible widgets once the frontend gets hold of it. On canvas it's a small box with a wire heading right. That's a deceptive first impression: this is the node that decides whether your character stays the same character across forty shots.

    The reason is what MiniMax H3 eats. H3 is omni-modal - text, image, video and audio in one context - so "keep her face and her voice consistent" isn't a LoRA problem here, it's a filing problem. Something has to hand the desk a stable, named pile of reference material: character images, scene plates, props, voice clips, video references, notes. That pile is this node. The desk compiles the @-references you type in shot prompts into actual H3 media tags, in the order each shot uses them.

    Skip it and you can still type prompts. You just lose the part where the prompt knows what "her" means.

    The mechanism, briefly

    The input is library_json, a required multiline STRING defaulting to {"assets":[]}; the frontend hides it and mounts the materials UI over the node instead - same trick the desk uses on project_json. On execute, build() parses that JSON, wraps the assets array in a small list subclass that also carries a reference_size config, and validates the result. The output is 素材库, typed STAR7_DIRECTOR_ASSET_LIBRARY - a custom type that exists purely so the desk will accept this and nothing else in the graph can.

    Wire it into the desk's asset_library socket and two things happen. The desk's frontend reads this node's assets to power prompt autocompletion, and when you save a project it writes the asset list back here, so the two stay in sync without you copying anything. At execution, the desk merges the library's list over the project's own - the set in the library is the set that gets compiled.

    This node is not an output node, so it never runs on its own; it builds when the graph needs its output. In practice you never queue it. It's a passive carrier.

    The one setting worth understanding

    Buried in the library JSON (picked in the UI, not a socket) is reference_size, and it's the most practically useful thing here: how reference images and videos are downscaled as they load, without touching the source files. Two modes - cap the long edge (defaults 1600px images, 800px videos), or cap total megapixels (1.5MP images, 0.5MP videos). Values land on a 32-pixel grid and are validated hard: long edges must be integers 32–8192, megapixels 0.1–64.

    Why care: H3 eats reference frames as context, and context is where your VRAM goes. 800px on the long edge for a video reference is a very different bill than the 1080p file on disk. Because the resize applies at load, you can dial it down to fit a shot on your card and back up for the final render, and no file is ever rewritten.

    Installing it

    No separate install - it ships with the desk. The pack is on the Comfy Registry: ComfyUI Manager, search star7-director, restart. By hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/star7code/star7-director
    cd star7-director
    /path/to/ComfyUI/venv/bin/python -m pip install -r requirements.txt
    

    Then hard-refresh the browser. The whole materials UI is front-end, and a cached tab can leave you staring at a grey rectangle that isn't actually a bug. Nothing model-side is specific to the library; the stills and voice clips it points at are yours to supply.

    Where people get burned

    It stores references, not files. Assets live under the project's data/projects/<project id>/media/, and the library holds IDs and paths. Share the workflow and your collaborator gets the cards with paths and none of the pixels - a plain workflow carries references, a project package carries the media. Handing a project to someone else means exporting the package, not the graph.

    Missing files are loud and survivable. Lose a file and the desk keeps the card, the @-reference and the shot settings, reporting it during preflight instead of quietly generating with one fewer reference. Put the file back and you're running again. Renaming an asset doesn't rewrite your prompt text either - references compile from stable IDs, so names are display only.

    Hand-editing the JSON is a real footgun. It's a plain json.loads at build time; one trailing comma there fails the node with a parse error nobody enjoys debugging. Use the UI.

    Don't expect it to organize for you. It won't guess which image is the character and which is the scene, and the compiler refuses to infer speaker numbers: if a character's voice is bound, you reference it, or the desk appends the audio tag after that character's image tag.

    Small node, real job. If you're running the desk at all, put this on the canvas first.

    CategoryStar7/导演台/素材

    Inputs (1)

    NameTypeDefaultDescription
    library_jsonSTRING{"assets":[]}—

    Outputs (1)

    NameTypeDescription
    素材库STAR7_DIRECTOR_ASSET_LIBRARY—