Nodes/ComfyUI ModelScope API Node/ModelScope-LoRA 多LoRA加载
ComfyUI Node

ModelScope-LoRA 多LoRA加载

Stack three hosted LoRAs without touching the config

By hujuying·Created 12 months ago·Updated 8 months ago· 67
ModelScope-LoRA 多LoRA加载
    • lora1_id
    • lora2_id
    • lora3_id
    • lora1_w
    • lora2_w
    • lora3_w
    lora1_preset无LoRA
    lora2_preset无LoRA
    lora3_preset无LoRA
    lora1_weight0.8
    lora2_weight0.8
    lora3_weight0.8
    lora1_use_customfalse
    lora2_use_customfalse
    lora3_use_customfalse

    The ModelScope image and edit nodes each have three LoRA slots, and filling all three with raw model IDs is tedious. This node is the multi-lane version of the pack's single LoRA loader: three preset dropdowns, three weights, and six outputs that plug straight into those slots. Nothing fancy, nothing hidden - if you're stacking a style LoRA with a character one and a detail fix, this is the wiring hub.

    How it works

    Like its single-loader sibling, it makes no API call. It reads the lora_presets list from modelscope_config.json and resolves three selections into IDs and weights.

    The inputs

    The inputs are three lora_preset dropdowns (lora1_preset, lora2_preset, lora3_preset), each with the same options - the five bundled Chinese-style presets plus 无LoRA (no LoRA). Below those sit per-lane weights and toggles:

    • lora1_weight / lora2_weight / lora3_weight (0–2, default 0.8) - the weights you want, when you want custom ones.
    • lora1_use_custom / lora2_use_custom / lora3_use_custom (booleans, default off) - per-lane switch between "use the preset's stored weight" (off) and "use the weight I typed" (on). You can mix: preset weight on lane one, custom weight on lanes two and three.

    Wiring it up

    Outputs are six values that match the image node's slot names exactly: lora1_id, lora2_id, lora3_id (STRINGs) and lora1_w, lora2_w, lora3_w (FLOATs). The naming lines up one-to-one with the lora1_id/lora1_wlora3_id/lora3_w inputs on ModelScopeImageNode and ModelScopeImageEditNode, so wiring is literally dragging each output onto the matching input. All six get packed into the API request's loras dict when the image node runs; the first LoRA also gets promoted to the request's primary lora/lora_weight fields.

    Two things worth knowing

    Two things worth knowing. First, a preset set to 无LoRA resolves to an empty ID, so it's fine to leave lanes unused - the image node skips empty ones. Second, the dropdown options are whatever's in modelscope_config.json at node-creation time; add presets via the ModelScopeLoraPresetNode and you'll see them on fresh nodes (or after reloading the workflow), not on already-placed ones.

    Installing it

    Install is the standard pack routine - ComfyUI Manager, searching "ComfyUI ModelScope API Node", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/hujuying/ComfyUI-ModelScope-API
    

    then restart ComfyUI. No extra dependencies; this is pure data plumbing, same as the single loader. Use this node when you stack two or three LoRAs, and the single-loader when you only ever use one - the outputs are identical, so swapping between them is a re-wire, not a re-think.

    CategoryModelScopeAPI/LoRA

    Inputs (9)

    NameTypeDefaultDescription
    lora1_presetCOMBO无LoRA6 options: 无LoRA, Qwen-小红书风格美人, Qwen-小红书甜妹, Qwen-小红薯-风格插画-排版, Qwen-真实人像小红书风格, Qwen-抖音小红书手持手机自拍美女
    lora2_presetCOMBO无LoRA6 options: 无LoRA, Qwen-小红书风格美人, Qwen-小红书甜妹, Qwen-小红薯-风格插画-排版, Qwen-真实人像小红书风格, Qwen-抖音小红书手持手机自拍美女
    lora3_presetCOMBO无LoRA6 options: 无LoRA, Qwen-小红书风格美人, Qwen-小红书甜妹, Qwen-小红薯-风格插画-排版, Qwen-真实人像小红书风格, Qwen-抖音小红书手持手机自拍美女
    lora1_weightoptFLOAT0.80–2
    lora2_weightoptFLOAT0.80–2
    lora3_weightoptFLOAT0.80–2
    lora1_use_customoptBOOLEANfalse
    lora2_use_customoptBOOLEANfalse
    lora3_use_customoptBOOLEANfalse

    Outputs (6)

    NameTypeDescription
    lora1_idSTRING
    lora2_idSTRING
    lora3_idSTRING
    lora1_wFLOAT
    lora2_wFLOAT
    lora3_wFLOAT