Update app.py
Browse files253 unmodified lines25425525625725825915 unmodified lines27527627727827928055 unmodified lines3363373383393403411075 unmodified lines141714181419142014211422253 unmodified lines# we never fetch, not as tensors), so these fall to the same `alpha = rank` default every other module gets.native_ab = re.compile(r"^(.+)\.(lora_[AB])\.\w+\.weight$")# Family B (Kohya-style): `lora_unet_blocks_N_TARGET.(lora_down|lora_up|alpha)` — covers SB and Fluid# Enhancer. `lora_down`/`lora_up` are the same A/B convention under a different name.kohya_ab = re.compile(15 unmodified lineselif name.startswith("blocks."):name = "transformer_blocks." + name[len("blocks."):]name = name.replace("final_layer.adaln_proj.linear", "norm_out.linear")name = name.replace(".attn.out_proj", ".attn.to_out.0")name = name.replace(".mlp.fc2", ".ff.net.2")name = name.replace(".mlp.fc1", ".ff.net.0.proj")55 unmodified linesprint(f"[lora-convert] '{module_base}' isn't a real target — skipping", flush=True)continuematch = standard_ab.match(key)if match:raw_base, ab = match.groups()1075 unmodified linesvalue=DEFAULT_INTERPOLATION,info="MiniMax-H3 generates 24 fps; FILM synthesizes the frames in between.",)upsample = gr.Checkbox(label="Upsample prompt",value=False,253 unmodified lines25425525625725825926026126226326426526615 unmodified lines28228328428528628728828929029129229355 unmodified lines3493503513523533543553563573583593603613623633643651075 unmodified lines1441144214431444144514461447253 unmodified lines# we never fetch, not as tensors), so these fall to the same `alpha = rank` default every other module gets.native_ab = re.compile(r"^(.+)\.(lora_[AB])\.\w+\.weight$")# Family D: already-diffusers-native base names, but with Kohya's `lora_down`/`lora_up` suffixes and no# `.weight` — confirmed against `lora1`'s own debug dump (`transformer_blocks.0.attn.to_k.lora_down`,# `transformer_blocks.0.adaln_proj.linear.lora_down`). Distinct from `native_ab` above (needs an adapter-name# segment plus `.weight`) and from `kohya_ab` below (needs the fused `lora_unet_blocks_N_TARGET` prefix). No# qkv-splitting needed either way: these base names already have separate `to_q`/`to_k`/`to_v`.native_kohya_suffix_ab = re.compile(r"^(?:diffusion_model\.)?(.+)\.(lora_down|lora_up)$")# Family B (Kohya-style): `lora_unet_blocks_N_TARGET.(lora_down|lora_up|alpha)` — covers SB and Fluid# Enhancer. `lora_down`/`lora_up` are the same A/B convention under a different name.kohya_ab = re.compile(15 unmodified lineselif name.startswith("blocks."):name = "transformer_blocks." + name[len("blocks."):]name = name.replace("final_layer.adaln_proj.linear", "norm_out.linear")name = name.replace("final_layer.video_out", "proj_out")name = name.replace("final_layer.audio_out", "audio_proj_out")name = name.replace("final_layer.norm", "norm_out.norm")name = name.replace("video_patch_proj", "proj_in")name = name.replace("audio_patch_proj", "audio_proj_in")name = name.replace("condition_proj", "context_embedder")name = name.replace(".attn.out_proj", ".attn.to_out.0")name = name.replace(".mlp.fc2", ".ff.net.2")name = name.replace(".mlp.fc1", ".ff.net.0.proj")55 unmodified linesprint(f"[lora-convert] '{module_base}' isn't a real target — skipping", flush=True)continuematch = native_kohya_suffix_ab.match(key)if match:raw_base, direction = match.groups()module_base = rename_base(raw_base) # covers the final_layer.*/patch_proj/condition_proj renames tooab = "lora_A" if direction == "lora_down" else "lora_B"if f"{module_base}.weight" in base_shapes:out[f"{LORA_KEY_PREFIX}.{module_base}.{ab}.weight"] = tensorelse:print(f"[lora-convert] '{raw_base}' renamed to '{module_base}', which isn't a real target — skipping", flush=True)continuematch = standard_ab.match(key)if match:raw_base, ab = match.groups()1075 unmodified linesvalue=DEFAULT_INTERPOLATION,info="MiniMax-H3 generates 24 fps; FILM synthesizes the frames in between.",)seed = gr.Number(label="Seed", value=42, precision=0)upsample = gr.Checkbox(label="Upsample prompt",value=False,
app.py+25