ComfyUI Node

TF ImageNet Class

The whole 'prompt' is one class label

By KorayUlusan·Created 3 days ago·Updated about 21 hours ago· 1
TF ImageNet Class
    • class_id
    • name
    class_name213 - Irish setter

    The small surprise of Trajectory Forcing is that there's no text prompt. The model is conditioned on an ImageNet-1k class id, an integer from 0 to 999, and that's the entire steering wheel. TF ImageNet Class is a glorified lookup table that turns a name you can read into the id the rest of the graph needs - because nobody can hold 1,000 class numbers in their head, and typing 213 when you mean "Irish setter" is how you generate something you didn't ask for.

    Its one input, class_name, is a dropdown of every ImageNet-1k class, formatted like 213 - Irish setter. Pick the class and the node hands back two outputs: class_id, an INT you wire into TF Generate's class_id slot, and name, the human-readable string, which is handy for provenance or just for seeing what the dropdown resolved to. That's it. This is about as thin as a node gets, and that's fine - it exists so the rest of the graph stays quotable and self-documenting.

    You might wonder whether it's worth the extra node instead of just typing the number into TF Generate. It is, for two reasons. One, the default class in TF Generate is 213 (Irish setter), and if you leave that in place you will generate a lot of setters before you notice. Two, the class label travels with the trajectory as metadata - TF Levels Info shows it, TF Save Levels writes it to the .npz, TF Save Images bakes it into PNG metadata - and it's far easier to trace a run that says "class 213: Irish setter" than a bare integer.

    Where beginners get tripped up: this is ImageNet-1k conditioning, so "dog" isn't a class but ~120 specific dog breeds are. You can't express a compound scene or a style, because there's no CLIP text encoder in the loop at all. What the model gives you instead is structure - object/background, then parts, then subparts - and the editing tools to rearrange those. If you're coming from a normal txt2img workflow, treat TF ImageNet Class as the "concept" picker and remember your real creative control lives in the edit nodes downstream, not in the prompt.

    If the dropdown looks incomplete, the class list is built from the fetched TrajectoryForcing checkout at startup; a missing checkout means the nodes still register but refuse to run, and the reason goes to the ComfyUI log.

    Install

    Same pack-wide story as every TF node: Manager → search Trajectory Forcing, or clone https://github.com/korayulusan/ComfyUI-TrajectoryForcing into custom_nodes/. This pack runs JAX inside ComfyUI and usually wants its own Python 3.11 environment on CUDA 12; requirements.txt is empty on purpose so a Manager install can't touch your torch, and install.py says no politely when your setup won't work. That's normal, not a failure - the README's env/setup.sh route is the fallback. First run downloads the model (~2 GB) and decoder (~1.6 GB) on its own.

    cd ComfyUI/custom_nodes/ComfyUI-TrajectoryForcing
    python -m tf_nodes.doctor   # ask the pack directly what's wrong
    

    Still not sure which class you want? TF Levels Info on an existing trajectory will tell you what class it used - wire its class_id output into TF Generate and you can re-sample that same concept on demand.

    CategoryTrajectoryForcing/generate

    Inputs (1)

    NameTypeDefaultDescription
    class_nameCOMBO213 - Irish setterWire the class_id output into TF Generate.

    Outputs (2)

    NameTypeDescription
    class_idINT
    nameSTRING