Nodes/ComfyUI-Texturaizer/Set Global Dir (Texturaizer)
ComfyUI Node

Set Global Dir (Texturaizer)

The one node every other Texturaizer node silently depends on

By LatentSpaceDirective·Created 2 years ago·Updated 8 months ago· 22
Set Global Dir (Texturaizer)
    • global_dir_path
    directory

    This is the least glamorous node in the Texturaizer pack and the one most people forget, which makes it the most likely reason your graph is returning empty strings. Set Global Dir stores a directory path in memory, and every Get * Data node in the pack falls back on it when you leave their directory_optional blank. No Set Global Dir, no fallback - and the whole family quietly reads nothing.

    Context: Texturaizer is a paid Blender addon by Luke Kratsios (LatentSpaceDirective) that exports per-object data and render passes to ComfyUI. These nodes are the free open-source side that reads those exports. Set Global Dir is the hub of the read path.

    What it does

    One required input, one output:

    • directory (STRING) - the path to the folder containing your exported data (the folder that has a data/ai_data.json inside it).
    • global_dir_path (STRING) - echoes the path back out, mostly as a way to show it in the graph.

    Under the hood it's dead simple: it stores the string on the class (Texturaizer_SetGlobalDir.global_dir_path) and prints a debug line to the console. Every Get * Data node then calls get_global_dir_path() when its own directory input is empty and joins it with data/ai_data.json to find the JSON. Note it's in-memory per ComfyUI process - there's no persistence, so you must wire this node into your graph (even if disconnected from everything else, a node with inputs still executes when the workflow runs).

    The critical caveat: what path are you setting?

    The node expects the folder that contains the data subdirectory, not the data folder itself. If you point it at <save>/data directly, the reader appends data/ai_data.json and looks for <save>/data/data/ai_data.json - which doesn't exist. This is the single most common setup mistake, and the failure is silent: the node returns {} rather than erroring, so you get empty strings and blank latents instead of a helpful traceback.

    How to wire it

    Practically, your graph has a "global" region at the top: one Set Global Dir, and every Get * node downstream leaves directory_optional empty. If you're processing multiple objects, you don't rewire per object - you point Set Global Dir at each object's folder before its batch, or pass per-object paths into directory_optional directly. The global dir is the default, not a straitjacket.

    Install

    Pack-level, once:

    cd ComfyUI/custom_nodes
    git clone https://github.com/LatentSpaceDirective/ComfyUI-Texturaizer
    

    or ComfyUI Manager → search "Texturaizer" → Install → restart. No extra dependencies, no model files.

    Troubleshooting cheat

    Outputs empty everywhere? Work the checklist: (1) is Set Global Dir wired with a valid folder? (2) does that folder contain data/ai_data.json - note the nested data/? (3) did you restart ComfyUI after install so the node class registered? (4) check the console for the [DEBUG] Global directory path set to: line to confirm what it's actually using. Nine times out of ten the answer is the wrong folder level. Get this node right and the rest of the pack's read-nodes start behaving.

    CategoryTexturaizer

    Inputs (1)

    NameTypeDefaultDescription
    directorySTRING

    Outputs (1)

    NameTypeDescription
    global_dir_pathSTRING