Nodes/SF ComfyUI Nodes/SF Claude Asset Director
ComfyUI Node

SF Claude Asset Director

Claude Picks Your Reference Images and Writes the Prompt, With No API Key

By Stillfront·Created 4 months ago·Updated a day ago· 1
SF Claude Asset Director
    • images
    • prompt
    • picked
    ◄library_path►
    ◄manifestmanifest.json►
    ◄system_prompt►
    ◄instruction►
    ◄max_images5►
    ◄pad_to_fittrue►
    ◄look_at_imagesfalse►
    ◄recursivetrue►
    ◄modeldefault►
    ◄timeout_seconds300►
    ◄seed0►

    If you work off a folder of your own art - characters, environments, props - the annoying part isn't generation. It's the two minutes before it: scrolling IMG_0421.png, deciding which three references go into the edit model, then writing a prompt that describes them in order. SF Claude Asset Director hands that decision to Claude and returns the reference batch and the matching prompt.

    This matters more than it used to. In 2026 the reference image goes into the edit model's context rather than into an adapter, and closed editors like Nano Banana Pro accept up to 14 at once - which makes picking the right ones the actual skill.

    How it works

    The trick is that Claude chooses from a text manifest, not from your pixels. Your library needs a manifest.json (or any text file) describing each asset in a line or two, and the node hands Claude that description plus the file listing. No image gets opened unless you ask. That's why a 4,000-file library costs the same per run as a 40-file one.

    Under the hood it shells out to the Claude Code CLI - claude -p <request> --output-format json - with the working directory set to your library root, and it asks for a strict JSON reply of {"files": [...], "prompt": "..."}. No API key, no per-token billing: it runs on your Claude Code login, the same mechanism as the pack's SF Claude Code node. Your brief and your manifest text do go to Anthropic, which is no different from typing them into Claude Code yourself.

    The inputs that matter

    • library_path - the folder. It expands ~, so a Google Drive for Desktop sync folder works fine; that's the intended setup.
    • instruction - the brief for this run. "Make a poster, pick the characters you think work best." It's your main steering wheel, and an empty one is a hard error.
    • manifest - filename inside the library, default manifest.json. Without one the node says so in the console and picks from filenames alone, which is exactly as good as it sounds.
    • max_images - default 5, capped at 20. Keep it inside what your downstream model accepts.
    • pad_to_fit - on by default. A ComfyUI IMAGE batch is one tensor, so every frame must share dimensions, and an asset library won't. On: scale to fit and centre on a shared canvas, aspect ratio intact, black bars. Off: stretch everything to one size. Padding is the safer default.
    • look_at_images - off by default and the reason this node is cheap. Turn it on and Claude actually reads the files (roughly 5s each) instead of trusting the manifest. Best fix for an unlabelled library, terrible idea for a big one.
    • system_prompt - standing rules, e.g. "only choose character assets unless a background is requested."
    • seed - not sent to Claude. It exists because ComfyUI caches node results; change it to force a fresh pick. recursive, model and timeout_seconds (300, for the whole call) round it out.

    Outputs

    Three. images is the batch of chosen references - wire it into the image input of Nano Banana, Seedream, Kontext, Qwen-Edit, whatever you're generating with. prompt is the text Claude wrote for those specific images, ordered to match them. picked is the filenames, newline-separated - send it to a Show Text node so you can see whether Claude's taste matches yours before you blame the sampler.

    Install

    Search "SF ComfyUI Nodes" in ComfyUI Manager, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Stillfront/comfyui-sf-nodes.git
    cd comfyui-sf-nodes
    pip install -r requirements.txt
    

    That requirements file covers all 62 nodes in the pack: torch, pillow, numpy<2.0.0, pydantic, plus google-genai and google-cloud-storage for the VertexAI nodes you aren't using here. Ignore config.ini.tmp - that's WaveSpeed only.

    The real dependency is Claude Code, installed and signed in on the machine running ComfyUI, found on PATH or in ~/.local/bin, ~/.claude/local, /opt/homebrew/bin, /usr/local/bin. Restart ComfyUI afterwards.

    Where people get burned

    "Claude Code CLI not found" even though claude works in your terminal. ComfyUI launched from a desktop shortcut, a container or a service inherits a different PATH than your shell login. And note what isn't in that candidate list: npm-global and nvm install locations. If yours lives under ~/.nvm/..., make sure ComfyUI's environment can see it.

    Nothing runs at all. This node isn't an output node, so a graph containing only it is rejected as having nothing to execute. Wire images into a Save Image or Preview Image node. And ComfyUI caches aggressively - if a re-queue returns the identical pick, that's the cache, not Claude refusing to think.

    Timeout with look_at_images on. Twenty images at ~5s each is over a minute before model time. On Opus with a long brief, 300s is not much - raise it or stop opening the images.

    Picks that don't exist. Claude occasionally invents a path. The node fuzzy-matches on basename, logs the misses, and errors only if none of them land - in which case your manifest probably doesn't describe what it asked for.

    Huge libraries get truncated. It lists at most the first 2,000 images it finds. Past that, split the library into subfolders and point separate node instances at them.

    If you only have ten assets you know by heart, skip this - you're faster by hand. It earns its place the moment "which refs?" stops being a question you can answer from memory.

    CategoryStillfront/LLM

    Inputs (11)

    NameTypeDefaultDescription
    library_pathSTRINGFolder holding the assets. For Google Drive, point this at your Drive for Desktop sync folder.
    manifestSTRINGmanifest.jsonFile inside the library describing each asset, used to choose between them. Written by SF Claude Library Builder, though any text or JSON works. Ignored if absent.
    system_promptSTRINGStanding instructions — how to choose, how to write the prompt.
    instructionSTRINGWhat you want this run. Type it here or wire a string in, e.g. 'Make a poster. Pick the characters you think work best.'
    max_imagesINT51–20Most reference images Claude may choose.
    pad_to_fitBOOLEANtrueOn: scale each image to fit a shared canvas and centre it, keeping aspect ratios. Off: stretch them all to one size.
    look_at_imagesBOOLEANfalseLet Claude open the image files as well as the manifest. Better choices on an unlabelled library, but roughly 5 seconds per image it opens.
    recursiveBOOLEANtrueInclude images in subfolders.
    modelCOMBOdefaultWhich Claude model decides.
    timeout_secondsINT30030–3600Give up if Claude has not replied within this long.
    seedINT00–4294967295Not sent to Claude. Change it to force a fresh choice instead of reusing ComfyUI's cached result.

    Outputs (3)

    NameTypeDescription
    imagesIMAGE—
    promptSTRING—
    pickedSTRING—