ComfyUI Node

YAML LoRA Extractor

Name:weight> apart into a name and a number you can wire anywhere

By avocadori·Created about a year ago·Updated about a year ago· 0
YAML LoRA Extractor
    • prompt
    • lora1_name
    • lora2_name
    • lora3_name
    • lora1_weight
    • lora2_weight
    • lora3_weight
    yaml_pathsetting.yaml
    category
    raw_lora_namesfalse

    If you've used A1111 or ComfyUI for more than a week, you've seen LoRA references written inline in prompts as <lora:character1_v1:0.8>. That's a compact way to store "which LoRA, at what strength" - and it's exactly what this pack's YAML files store. YAML LoRA Extractor exists to take that notation back apart: give it a category, and it returns the prompt plus three LoRA names and three weights as separate outputs, with the names checked against your actual models/loras folder.

    It's the middle piece of the modular workflow the pack's README pushes. YAML Image Cycler (Simple) handles images and masks; this node handles the prompt and LoRA data; YAMLLoRASelector handles the Wan side. If you'd rather build your graph out of small, testable nodes than one giant cycler that does everything, this is the one you reach for.

    How it works

    For each of lora1/lora2/lora3 in the category's YAML block, it parses the <lora:name:weight> string into name and weight. A bare name with no wrapper works too - it just gets weight 1.0. Crucially, it validates names against folder_paths.get_filename_list("loras"), which is ComfyUI's real LoRA index. That's the correct way to do it, and it's noticeably better than the Full cycler node's manual walk-up-the-directory search.

    The raw_lora_names toggle switches between two behaviors:

    • Off (default) - "validated" mode. Your YAML name is looked up in the actual lora list, case-insensitively, and you get back the real filename including extension and any subfolder. So character1_v1 in your YAML resolves to characters/Character1_V1.safetensors if that's what's on disk.
    • On - "raw" mode. You get exactly the name as written in the YAML, verbatim. It still warns in the console if it can't match anything, but it won't rewrite what you typed.

    Inputs and outputs

    Inputs are yaml_path (default setting.yaml), category (dropdown from your YAML keys, or free text) and that raw_lora_names boolean. Outputs are prompt (STRING), lora1_name/lora2_name/lora3_name, and lora1_weight/lora2_weight/lora3_weight (FLOAT). The name outputs are typed * in the schema - a wildcard, so ComfyUI lets you connect them to just about anything; in practice they're strings.

    Where do the pairs go? The README's stated compatibility target is WanVideo Lora Select, and a name-plus-weight pair is exactly what that node consumes - that's the clean path for a Wan 2.1/2.2 pipeline. Alternatively, concatenate them back into <lora:name:weight> if you want to keep prompt-string style. The point is the data is now separate, so you can route, compare, or format it however your graph needs.

    Installing

    Same as the rest of the pack - no extra Python dependencies, clone and restart:

    cd ComfyUI/custom_nodes
    git clone https://github.com/avocadori/ComfyUI-load-image-prompt-lora
    

    Or search ComfyUI-load-image-prompt-lora in ComfyUI Manager.

    Common issues

    • Console warnings listing every LoRA you own - that's the validation failing to match a name. Check the YAML spelling against the actual filenames; the warning prints the full list so you can compare.
    • A weight that refuses to be a number - if the :0.8 part isn't parseable, the node silently falls back to 1.0. Worth knowing when a LoRA suddenly hits at full strength.
    • Two files with the same name, different extensions - the source notes the later one wins in the internal map. If that bites you, make the filenames unique.
    CategoryLoaders

    Inputs (3)

    NameTypeDefaultDescription
    yaml_pathSTRINGsetting.yaml
    categorySTRING
    raw_lora_namesBOOLEANfalse

    Outputs (7)

    NameTypeDescription
    promptSTRING
    lora1_name*
    lora2_name*
    lora3_name*
    lora1_weightFLOAT
    lora2_weightFLOAT
    lora3_weightFLOAT