fix(lora-worker): default network_alpha to dim/2 to match proven Sindra runs

comfy-dev cross-check: Sindra v1/v2 used alpha=dim/2 (0.5 LoRA scaling),
which produced the validated likeness; the initial alpha=dim (1.0) was a
stronger, unvalidated default. Align the default to the proven value
(operator/per-request can still override). Tests updated (14 green).
This commit is contained in:
2026-07-06 18:38:28 -07:00
parent 888ba6a714
commit 3a08abd60d
2 changed files with 6 additions and 3 deletions
@@ -124,8 +124,8 @@ def test_relative_dataset_dir_rejected():
def test_alpha_scales_with_dim():
_, _, params = build_command(_req(tier="fast"))
# fast -> dim 16; alpha = dim * ratio (default 1.0) = 16
# fast -> dim 16; alpha = dim * ratio (0.5, matching Sindra) = 8
argv, _, _ = build_command(_req(tier="fast"))
assert _flag_value(argv, "--network_dim") == "16"
assert _flag_value(argv, "--network_alpha") == "16"
assert _flag_value(argv, "--network_alpha") == "8"
assert params["dim"] == 16
@@ -76,7 +76,10 @@ SDXL_HPARAMS = {
"lr_warmup_steps": "0",
"train_batch_size_lean": "1", # 3090
"train_batch_size_full": "2", # A6000
"network_alpha_ratio": 1.0, # alpha = dim * ratio
# alpha = dim * ratio. 0.5 (alpha=dim/2) matches the PROVEN Sindra v1/v2 runs (comfy-dev
# cross-check 2026-07-06) — it's the scaling that produced the validated likeness. alpha=dim
# (1.0) is a valid stronger default but wasn't what Sindra used; operator can override.
"network_alpha_ratio": 0.5,
"min_snr_gamma": "5",
"noise_offset": "0.1",
"save_precision": "bf16",