Spaces:
Paused
Paused
add dual lora loading (#1)
Browse files- add dual lora loading (55f8abb7e38c743cef07c6c9ecd712593d43b8ff)
- Update app.py (989357c225509fca4f985bafcbc1578035ea17f5)
Files changed (2)
- app.py+23-6
- requirements.txt+1-1
45 unmodified lines4647484950515253545556575859606162636454555665666768697071727374757659777879138 unmodified lines21821922020420522122222322422545 unmodified lines).to('cuda')
# load, fuse, unload before compilation# pipe.load_lora_weights(# "vrgamedevgirl84/Wan14BT2VFusioniX", # weight_name="FusionX_LoRa/Phantom_Wan_14B_FusionX_LoRA.safetensors", # adapter_name="phantom"# )
# pipe.set_adapters(["phantom"], adapter_weights=[0.95])# pipe.fuse_lora(adapter_names=["phantom"], lora_scale=1.0)# pipe.unload_lora_weights()
pipe.load_lora_weights( "vrgamedevgirl84/Wan14BT2VFusioniX", weight_name="FusionX_LoRa/Phantom_Wan_14B_FusionX_LoRA.safetensors", adapter_name="phantom")
pipe.set_adapters(["phantom"], adapter_weights=[0.95])pipe.fuse_lora(adapter_names=["phantom"], lora_scale=1.0)kwargs = {}kwargs["load_into_transformer_2"] = Truepipe.load_lora_weights( "vrgamedevgirl84/Wan14BT2VFusioniX", weight_name="FusionX_LoRa/Phantom_Wan_14B_FusionX_LoRA.safetensors", adapter_name="phantom_2", **kwargs)pipe.set_adapters(["phantom", "phantom_2"], adapter_weights=[1., 1.])pipe.fuse_lora(adapter_names=["phantom"], lora_scale=3., components=["transformer"])pipe.fuse_lora(adapter_names=["phantom_2"], lora_scale=1., components=["transformer_2"])pipe.unload_lora_weights()
optimize_pipeline_(pipe, image=Image.new('RGB', (LANDSCAPE_WIDTH, LANDSCAPE_HEIGHT)), prompt='prompt',138 unmodified lines seed_input = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=42, interactive=True) randomize_seed_checkbox = gr.Checkbox(label="Randomize seed", value=True, interactive=True) steps_slider = gr.Slider(minimum=1, maximum=30, step=1, value=6, label="Inference Steps") guidance_scale_input = gr.Slider(minimum=0.0, maximum=10.0, step=0.5, value=2.5, label="Guidance Scale - high noise stage") guidance_scale_2_input = gr.Slider(minimum=0.0, maximum=10.0, step=0.5, value=3.5, label="Guidance Scale 2 - low noise stage") guidance_scale_input = gr.Slider(minimum=0.0, maximum=10.0, step=0.5, value=3, label="Guidance Scale - high noise stage") guidance_scale_2_input = gr.Slider(minimum=0.0, maximum=10.0, step=0.5, value=1, label="Guidance Scale 2 - low noise stage")
generate_button = gr.Button("Generate Video", variant="primary") with gr.Column():11234git+https://github.com/huggingface/diffusers.git@5512d70f7fd89f69511d9c23f1473a49f7901beegit+https://github.com/linoytsaban/diffusers.git@wan22-lorastransformersacceleratesafetensorsapp.py+23-6
requirements.txt+1-1