Enhance: LoRA switches per template (Animate first) #218

Open
opened 2026-11-03 17:34:56 +00:00 by cameron · 0 comments
Owner

Let the app turn optional LoRAs on and off for a template, starting with Animate (Wan 2.2 i2v).

Scope

  • Add-on LoRAs only (style or motion). The 4-step lightx2v LoRAs stay fixed: the template's 4 steps at CFG 1.0 and its high/low split depend on them. A slower, higher-quality Animate would be its own template.
  • Alternate models are their own workflow, not a switch. For example, an alternate Wan 2.2 high/low model pair becomes its own Animate template.

Proposed design

  1. Workflow: a switchable LoraLoaderModelOnly is titled imageapi:lora:<id>. For Wan, the high-noise and low-noise nodes share the id, so one switch drives both.
  2. enhance.toml: each switch is declared per template with an id, a label and a default:
    [[template.lora]]
    id = "style"
    label = "Style"
    default = false
    
    An imageapi:lora:<id> node with no declaration is fixed at its exported strength. A declared id that has no matching node is a startup warning, and that switch is skipped.
  3. GET /enhance/templates: each template gains loras: [{id, label, default}].
  4. POST /enhance: takes loras: {id: bool}. Omitted ids use their default, and an unknown id is a 400. A disabled LoRA gets strength_model = 0, so the graph is never rewired. The job stores the resolved switches, so a retry or adjust repeats the same choice.
  5. App (FileViewer-React): templates with LoRAs show their switches in the Enhance sheet. Adjust restores the job's choice.

Strength (moved in, 2026-11-03)

  • Each switch also has a strength scale: strength/min/max in enhance.toml, and loras: {id: true | false | scale} in requests.
  • The scale multiplies the exported strengths, so 1.0 means as exported, 0 means off, and a high/low pair keeps its ratio.
  • Implemented in ImageApi PR #219.

Later (not planned)

  • Choosing an arbitrary LoRA file per request, rather than predeclared switches. It would need nodes inserted dynamically, as a separate field.
  • Several switches can already be on at once. Ordering doesn't matter, because LoRA patches add up.

🤖 Generated with Claude Code

Let the app turn optional LoRAs on and off for a template, starting with Animate (Wan 2.2 i2v). ## Scope - **Add-on LoRAs only** (style or motion). The 4-step lightx2v LoRAs stay fixed: the template's 4 steps at CFG 1.0 and its high/low split depend on them. A slower, higher-quality Animate would be its own template. - **Alternate models are their own workflow, not a switch.** For example, an alternate Wan 2.2 high/low model pair becomes its own Animate template. ## Proposed design 1. **Workflow:** a switchable `LoraLoaderModelOnly` is titled `imageapi:lora:<id>`. For Wan, the high-noise and low-noise nodes share the id, so one switch drives both. 2. **enhance.toml:** each switch is declared per template with an id, a label and a default: ```toml [[template.lora]] id = "style" label = "Style" default = false ``` An `imageapi:lora:<id>` node with no declaration is fixed at its exported strength. A declared id that has no matching node is a startup warning, and that switch is skipped. 3. **`GET /enhance/templates`:** each template gains `loras: [{id, label, default}]`. 4. **`POST /enhance`:** takes `loras: {id: bool}`. Omitted ids use their default, and an unknown id is a 400. A disabled LoRA gets `strength_model = 0`, so the graph is never rewired. The job stores the resolved switches, so a retry or adjust repeats the same choice. 5. **App (FileViewer-React):** templates with LoRAs show their switches in the Enhance sheet. Adjust restores the job's choice. ## Strength (moved in, 2026-11-03) - Each switch also has a strength scale: `strength`/`min`/`max` in enhance.toml, and `loras: {id: true | false | scale}` in requests. - The scale multiplies the exported strengths, so 1.0 means as exported, 0 means off, and a high/low pair keeps its ratio. - Implemented in ImageApi PR #219. ## Later (not planned) - Choosing an arbitrary LoRA file per request, rather than predeclared switches. It would need nodes inserted dynamically, as a separate field. - Several switches can already be on at once. Ordering doesn't matter, because LoRA patches add up. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.