Nodes/Hunyuan LoRA Loader Nodes/Hunyuan Video LoRA Loader - Load Loras from prompt
ComfyUI Node

Hunyuan Video LoRA Loader - Load Loras from prompt

Trigger-word LoRA loading — and where that config actually lives

By PixelFunAI·Created 2 years ago·Updated 2 years ago· 3
Hunyuan Video LoRA Loader - Load Loras from prompt
  • model
  • model
prompt
config_filelora_triggers.yaml

The idea behind HunyuanLoraFromPrompt is genuinely nice: you keep a YAML file that maps trigger words to Hunyuan Video LoRAs, and then you just... write prompts. "A kerbal astronaut on the moon" automatically loads the kerbal LoRA; mention the spacesuit and it loads that too. No node wiring per LoRA, no remembering which filename does what. The prompt text is the loader.

This is the pack's least-impressed node - zero search impressions at the time of writing - which tells you something. It's a niche convenience feature on top of a niche pack. But if you work with a handful of character or concept LoRAs and keep reusing the same trigger vocabulary, it genuinely removes a step every single render.

How it works

The node scans your prompt against a list of trigger configs and applies every LoRA whose keyword appears. Under the hood it's the same apply machinery as the rest of the pack: it filters each LoRA's tensors by the block settings cached for it, then runs them through ComfyUI's standard LoRA loader, chaining multiple matches in config order.

The config is a YAML file, lora_triggers.yaml by default:

loras:
  - filename: kerbal30.safetensors
    strength: 0.75
    use_block_cache: true
    use_single_blocks: false
    keywords:
      - kerbal
      - astronaut
      - spacesuit

The config_file input lets you point at a different file if you want separate profiles.

The inputs and output

Three inputs, one output:

  • model - base model to patch (MODEL in).
  • prompt - the multiline text you're checking for triggers. This is what drives everything.
  • config_file - filename of the YAML config, default lora_triggers.yaml.
  • Output: the patched model.

Where this thing hides its sharp edges

  • The config does not live where you think. The file is read from ComfyUI/custom_nodes/ComfyUI_PixelFun/cache/ - inside the custom node folder, not your models directory. On the first run with no file present, the node helpfully creates a template with a commented-out example. Helpful until the day you git pull an update to the node and it silently regenerates over your carefully-built config, or you delete the folder to reinstall and lose everything. Back this file up; it's precious and it's hidden.
  • Matching is substring, not word-exact. Everything is lowercased, and "kerbal" matches "kerbal", "kerbal30", and "notkerbal". A short keyword like "cat" will fire on "category". Keep keywords distinctive or you'll get surprise LoRAs.
  • No match is silent. If nothing triggers, you get your model back unchanged with only a console log. If your render looks like it has no LoRA at all, check the terminal before you blame the sampler.
  • One inconsistency worth knowing: in this node the use_single_blocks default is true in the code, while the JSON node defaults it to false. If a LoRA behaves differently loaded via prompt than via JSON, that's probably why. Toggling use_single_blocks off won't help you here - it's read from the YAML entry, so set it explicitly.

Installing it

Same as the rest of the pack, and it's light:

cd ComfyUI/custom_nodes
git clone https://github.com/PixelFunAI/ComfyUI_PixelFun

Restart ComfyUI, or grab "Hunyuan LoRA Loader Nodes" from ComfyUI Manager. No extra dependencies, no model downloads.

Bottom line: worth it if you have a stable roster of Hunyuan LoRAs and hate loader spaghetti. For everyone else it's a neat idea you'll try once, forget you have, and rediscover when the config file mysteriously reappears after an update. Set-and-forget it, and back up that YAML.

Categoryloaders/hunyuan

Inputs (3)

NameTypeDefaultDescription
modelMODEL
promptSTRING
config_fileSTRINGlora_triggers.yaml

Outputs (1)

NameTypeDescription
modelMODEL