Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import torch
|
| 2 |
-
from diffusers import UniPCMultistepScheduler
|
| 3 |
from diffusers import WanPipeline, AutoencoderKLWan # Use Wan-specific VAE
|
| 4 |
# from diffusers.hooks import apply_first_block_cache, FirstBlockCacheConfig
|
| 5 |
from para_attn.first_block_cache.diffusers_adapters import apply_cache_on_pipe
|
|
@@ -19,13 +19,23 @@ flow_shift = 1.0 #5.0 1.0 for image, 5.0 for 720P, 3.0 for 480P
|
|
| 19 |
# pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config, flow_shift=flow_shift)
|
| 20 |
|
| 21 |
# Configure DDIMScheduler with a beta schedule
|
| 22 |
-
pipe.scheduler = DDIMScheduler.from_config(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
pipe.scheduler.config,
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
flow_shift=flow_shift
|
| 29 |
)
|
| 30 |
|
| 31 |
|
|
|
|
| 1 |
import torch
|
| 2 |
+
from diffusers import UniPCMultistepScheduler, FlowMatchEulerDiscreteScheduler, DDIMScheduler
|
| 3 |
from diffusers import WanPipeline, AutoencoderKLWan # Use Wan-specific VAE
|
| 4 |
# from diffusers.hooks import apply_first_block_cache, FirstBlockCacheConfig
|
| 5 |
from para_attn.first_block_cache.diffusers_adapters import apply_cache_on_pipe
|
|
|
|
| 19 |
# pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config, flow_shift=flow_shift)
|
| 20 |
|
| 21 |
# Configure DDIMScheduler with a beta schedule
|
| 22 |
+
# pipe.scheduler = DDIMScheduler.from_config(
|
| 23 |
+
# pipe.scheduler.config,
|
| 24 |
+
# beta_start=0.00085, # Starting beta value
|
| 25 |
+
# beta_end=0.012, # Ending beta value
|
| 26 |
+
# beta_schedule="linear", # Linear beta schedule (other options: "scaled_linear", "squaredcos_cap_v2")
|
| 27 |
+
# num_train_timesteps=1000, # Number of timesteps
|
| 28 |
+
# flow_shift=flow_shift
|
| 29 |
+
# )
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
# Configure FlowMatchEulerDiscreteScheduler
|
| 33 |
+
pipe.scheduler = FlowMatchEulerDiscreteScheduler.from_config(
|
| 34 |
pipe.scheduler.config,
|
| 35 |
+
num_train_timesteps=1000, # Standard timestep count
|
| 36 |
+
sigma_min=0.002, # Minimum noise level
|
| 37 |
+
sigma_max=700.0, # Maximum noise level
|
| 38 |
+
flow_shift=1.0 # Retain flow_shift for WanPipeline compatibility
|
|
|
|
| 39 |
)
|
| 40 |
|
| 41 |
|