ComfyUI Node

YAML LoRA Selector

Feeds YAML-defined LoRA stacks straight into a Wan video pipeline

By avocadori·Created about a year ago·Updated about a year ago· 0
YAML LoRA Selector
    • wanvid_lora
    • yaml_path
    category
    yaml_pathsetting.yaml

    YAML LoRA Selector is the node that makes the whole pack click if you're doing Wan video. Everything else in ComfyUI-load-image-prompt-lora deals in prompts and name strings; this one emits a WANVIDLORA - the same data type that Kijai's WanVideoWrapper WanVideoLoraSelect node produces - so a YAML-defined LoRA stack can go straight into a Wan 2.1/2.2 workflow with zero hand-placed LoraLoaders per run.

    The use case lines up with how the Wan community actually works: people stay on Wan because of its LoRA library, and the character-consistency workflow - a character LoRA trained on a couple dozen stills, swapped in per shot - is the default way to keep a face stable across frames. This node automates the swap: you pick a category, it reads that category's LoRA settings, resolves them against your models/loras, and hands the pipeline a ready-made LoRA stack with weights intact.

    How it works

    For each of lora1/lora2/lora3 in the category's YAML block, it parses <lora:name:weight> into a name and weight, matches the name against your installed LoRAs (exact, then case-insensitive), and resolves the full file path via folder_paths.get_full_path. Each resolved LoRA becomes a dict shaped exactly like the one WanVideoLoraSelect emits:

    {"path": "/.../models/loras/character1_v1.safetensors",
     "strength": 0.8, "name": "character1_v1",
     "blocks": {}, "layer_filter": "", "low_mem_load": False}
    

    blocks and layer_filter aren't supported - you get empty values there, so per-block LoRA targeting isn't possible through this node. The list of these dicts is the wanvid_lora output.

    Inputs and outputs

    Inputs are category (required - a dropdown from your YAML's keys, or free text if the file wasn't visible at startup) and yaml_path (optional, default setting.yaml). Outputs are wanvid_lora (WANVIDLORA) and yaml_path (STRING, echoed through).

    Two ways to wire the output:

    • Directly into WanVideoModelLoader's lora input - one YAML category = one LoRA stack applied at load.
    • Into WanVideoLoraSelect's prev_lora input - to chain more LoRAs on top of what the YAML defined.

    Installing

    No dependencies beyond what ComfyUI ships - clone and restart:

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

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

    Common issues

    • "No available LoRA files found" warning - your models/loras came back empty from ComfyUI's perspective. Check the files are in the right folder and ComfyUI sees them in a normal LoraLoader.
    • The LoRA silently becomes "None". Unmatched names don't crash the run - the node logs a warning and returns a default "None" entry. A category that doesn't exist in the YAML behaves the same way rather than erroring, so check the console if a run looks wrong.
    • Strength comes straight from the YAML. If <lora:name:0.3> doesn't look strong enough, that's your number to edit - the selector faithfully passes it through. Remember the community's rule of thumb that a default strength of 1.0 is often too hot; 0.5–0.8 is a common starting range.
    CategoryLoaders

    Inputs (2)

    NameTypeDefaultDescription
    categoryCOMBO1 options: STRING
    yaml_pathoptSTRINGsetting.yaml

    Outputs (2)

    NameTypeDescription
    wanvid_loraWANVIDLORA
    yaml_pathSTRING