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

ModelScope-LoRA 单LoRA加载

Pick a hosted LoRA from a dropdown, feed the image node

By hujuying·Created 12 months ago·Updated 8 months ago· 67
ModelScope-LoRA 单LoRA加载
    • lora_id
    • lora_weight
    lora_preset无LoRA
    lora_weight0.8
    use_custom_weightfalse

    If you've used the ModelScope-Image or Image-Edit nodes, you've seen the lora1_id / lora1_w text fields sitting there empty. Those fields want a LoRA model ID as a string and a weight as a float, and typing model IDs by hand is how mistakes happen. This node exists so you don't have to: it turns the pack's saved LoRA presets into a dropdown and outputs the selected one's ID and weight, ready to wire in.

    How it works

    That's the whole job. No API call happens here - the node reads the lora_presets list from modelscope_config.json and hands back two values:

    • lora_id (STRING) - the ModelScope LoRA model ID from the chosen preset, e.g. qiyuanai/TikTok_Xiaohongshu_career_line_beauty_v1.
    • lora_weight (FLOAT) - the preset's stored weight, or your override.

    The one input that matters is lora_preset, a dropdown built from the config's preset list (default "无LoRA", meaning no LoRA - an empty ID). The other two are the weight controls: lora_weight (0–2, default 0.8) is your value, and use_custom_weight (boolean, default off) decides whether your value gets used or whether the preset's stored weight wins. Leave it off and you get the preset's defaults; flip it on to tune one run without editing the preset.

    Wiring it up

    Wire it up like this: lora_id → the lora1_id input on a ModelScopeImageNode or ModelScopeImageEditNode, lora_weight → that node's lora1_w. Run the image node and the LoRA rides along in the API request's loras payload.

    The preset list is the same one the pack ships with - the Chinese Xiaohongshu/Douyin-style LoRAs - so on a fresh install your dropdown options are those five plus 无LoRA. To add your own, use the ModelScopeLoraPresetNode, or edit modelscope_config.json directly. Either way, remember the dropdown is captured when the node is created, so new presets show up on fresh nodes (or after reloading the workflow), not retroactively.

    Installing it

    Installation 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 - it's pure data plumbing. If you only ever use one LoRA at a time, this is the node you want; the moment you need two or three stacked, the multi-loader version below is the same thing with three lanes.

    CategoryModelScopeAPI/LoRA

    Inputs (3)

    NameTypeDefaultDescription
    lora_presetCOMBO无LoRA6 options: 无LoRA, Qwen-小红书风格美人, Qwen-小红书甜妹, Qwen-小红薯-风格插画-排版, Qwen-真实人像小红书风格, Qwen-抖音小红书手持手机自拍美女
    lora_weightoptFLOAT0.80–2
    use_custom_weightoptBOOLEANfalse

    Outputs (2)

    NameTypeDescription
    lora_idSTRING
    lora_weightFLOAT