feat(enhance): LoRA strength scale alongside the on/off switch (#218)

So the app builds against the final shape: each [[template.lora]] gains
`strength` (the scale when on, default 1.0) and `min` / `max` (the
slider's range, default 0.0-1.5).

- POST /enhance `loras` takes true / false or a scale: true = strength,
  false or <= 0 = off, a scale is clamped to min..max.
- The scale multiplies each node's exported strength_model /
  strength_clip, so 1.0 = as exported and a high/low pair keeps its
  ratio.
- Jobs and the job view store the resolved scale per id (0 = off);
  GET /enhance/templates lists strength, min and max.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cameron CordesandClaude Opus 5.5 committed 2026-11-03 14:01:04 -05:00
1 parent 31da21e061
commit cc96873f86
7 files changed
+298 -110

No files matched your search

+11 -5
View File
@@ -64,11 +64,14 @@ prompt_mode = "replace"
# label = "Restore (Dev, slow)"
# file = "/media/nas/image_fibo2_restore_imageapi_API.json"
# A video template with optional LoRAs the app can switch on or off (#218).
# Each [[template.lora]] matches the workflow's LoRA loader nodes titled
# "imageapi:lora:<id>" (Wan's high- and low-noise pair share one id). Off sets
# their strength_model (and strength_clip) to 0; the graph isn't rewired.
# Nodes titled that way with no entry here keep their exported strength.
# A video template with optional LoRAs the app can switch on or off and scale
# (#218). Each [[template.lora]] matches the workflow's LoRA loader nodes titled
# "imageapi:lora:<id>" (Wan's high- and low-noise pair share one id). The
# request's scale multiplies each node's exported strength_model (and
# strength_clip), so 1.0 = as exported, 0 = off and a pair keeps its ratio; the
# graph isn't rewired. Any number of switches can be on at once (LoRA patches
# add up, so their order in the graph doesn't matter). Nodes titled that way
# with no entry here keep their exported strength.
[[template]]
name = "animate"
label = "Animate"
@@ -81,3 +84,6 @@ output_megapixels = 0.92
id = "style" # node title "imageapi:lora:style"
label = "Style"
default = false # default: false; used when the request omits it
strength = 1.0 # default: 1.0; the scale when on without a number
min = 0.0 # default: 0.0; slider range while on (a requested
max = 1.5 # default: 1.5; scale is clamped; <= 0 is off)