Update app.py
Browse files
app.py
CHANGED
|
@@ -100,7 +100,7 @@ pipe.load_lora_weights(
|
|
| 100 |
adapter_name="livewallpaper"
|
| 101 |
)
|
| 102 |
pipe.set_adapters(["livewallpaper"], adapter_weights=[1.])
|
| 103 |
-
pipe.fuse_lora(adapter_names=["livewallpaper"], lora_scale
|
| 104 |
pipe.unload_lora_weights()
|
| 105 |
|
| 106 |
quantize_(pipe.text_encoder, Int8WeightOnlyConfig())
|
|
@@ -221,13 +221,11 @@ def run_inference(
|
|
| 221 |
scheduler_class = SCHEDULER_MAP.get(scheduler_name)
|
| 222 |
if scheduler_class.__name__ != pipe.scheduler.config._class_name or flow_shift != pipe.scheduler.config.get("flow_shift", "shift"):
|
| 223 |
config = copy.deepcopy(original_scheduler.config)
|
| 224 |
-
print("update scheduler")
|
| 225 |
if scheduler_class == FlowMatchEulerDiscreteScheduler:
|
| 226 |
config['shift'] = flow_shift
|
| 227 |
else:
|
| 228 |
config['flow_shift'] = flow_shift
|
| 229 |
pipe.scheduler = scheduler_class.from_config(config)
|
| 230 |
-
print(pipe.scheduler.config)
|
| 231 |
|
| 232 |
result = pipe(
|
| 233 |
image=resized_image,
|
|
@@ -353,11 +351,11 @@ with gr.Blocks() as demo:
|
|
| 353 |
prompt_input = gr.Textbox(label="Prompt", value=default_prompt_i2v)
|
| 354 |
duration_seconds_input = gr.Slider(minimum=MIN_DURATION, maximum=MAX_DURATION, step=0.1, value=3.5, label="Duration (seconds)", info=f"Clamped to model's {MIN_FRAMES_MODEL}-{MAX_FRAMES_MODEL} frames at {FIXED_FPS}fps.")
|
| 355 |
steps_slider = gr.Slider(minimum=1, maximum=30, step=1, value=6, label="Inference Steps")
|
| 356 |
-
quality_slider = gr.Slider(minimum=1, maximum=10, step=1, value=6, label="Video Quality")
|
| 357 |
|
| 358 |
with gr.Accordion("Advanced Settings", open=False):
|
| 359 |
last_image_component = gr.Image(type="pil", label="Last Image (Optional)")
|
| 360 |
negative_prompt_input = gr.Textbox(label="Negative Prompt", value=default_negative_prompt, info="Used if any Guidance Scale > 1.", lines=3)
|
|
|
|
| 361 |
seed_input = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=42, interactive=True)
|
| 362 |
randomize_seed_checkbox = gr.Checkbox(label="Randomize seed", value=True, interactive=True)
|
| 363 |
guidance_scale_input = gr.Slider(minimum=0.0, maximum=10.0, step=0.5, value=1, label="Guidance Scale - high noise stage")
|
|
|
|
| 100 |
adapter_name="livewallpaper"
|
| 101 |
)
|
| 102 |
pipe.set_adapters(["livewallpaper"], adapter_weights=[1.])
|
| 103 |
+
pipe.fuse_lora(adapter_names=["livewallpaper"], lora_scale=.7, components=["transformer"])
|
| 104 |
pipe.unload_lora_weights()
|
| 105 |
|
| 106 |
quantize_(pipe.text_encoder, Int8WeightOnlyConfig())
|
|
|
|
| 221 |
scheduler_class = SCHEDULER_MAP.get(scheduler_name)
|
| 222 |
if scheduler_class.__name__ != pipe.scheduler.config._class_name or flow_shift != pipe.scheduler.config.get("flow_shift", "shift"):
|
| 223 |
config = copy.deepcopy(original_scheduler.config)
|
|
|
|
| 224 |
if scheduler_class == FlowMatchEulerDiscreteScheduler:
|
| 225 |
config['shift'] = flow_shift
|
| 226 |
else:
|
| 227 |
config['flow_shift'] = flow_shift
|
| 228 |
pipe.scheduler = scheduler_class.from_config(config)
|
|
|
|
| 229 |
|
| 230 |
result = pipe(
|
| 231 |
image=resized_image,
|
|
|
|
| 351 |
prompt_input = gr.Textbox(label="Prompt", value=default_prompt_i2v)
|
| 352 |
duration_seconds_input = gr.Slider(minimum=MIN_DURATION, maximum=MAX_DURATION, step=0.1, value=3.5, label="Duration (seconds)", info=f"Clamped to model's {MIN_FRAMES_MODEL}-{MAX_FRAMES_MODEL} frames at {FIXED_FPS}fps.")
|
| 353 |
steps_slider = gr.Slider(minimum=1, maximum=30, step=1, value=6, label="Inference Steps")
|
|
|
|
| 354 |
|
| 355 |
with gr.Accordion("Advanced Settings", open=False):
|
| 356 |
last_image_component = gr.Image(type="pil", label="Last Image (Optional)")
|
| 357 |
negative_prompt_input = gr.Textbox(label="Negative Prompt", value=default_negative_prompt, info="Used if any Guidance Scale > 1.", lines=3)
|
| 358 |
+
quality_slider = gr.Slider(minimum=1, maximum=10, step=1, value=6, label="Video Quality")
|
| 359 |
seed_input = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=42, interactive=True)
|
| 360 |
randomize_seed_checkbox = gr.Checkbox(label="Randomize seed", value=True, interactive=True)
|
| 361 |
guidance_scale_input = gr.Slider(minimum=0.0, maximum=10.0, step=0.5, value=1, label="Guidance Scale - high noise stage")
|