Spaces:
Running
on
Zero
Running
on
Zero
Update app_v3.py
Browse files
app_v3.py
CHANGED
|
@@ -23,7 +23,7 @@ from typing import Generator
|
|
| 23 |
import gradio as gr
|
| 24 |
from huggingface_hub import CommitScheduler, HfApi, logging
|
| 25 |
from debug import log_params, scheduler
|
| 26 |
-
|
| 27 |
logging.set_verbosity_debug()
|
| 28 |
|
| 29 |
huggingface_token = os.getenv("HUGGINFACE_TOKEN")
|
|
@@ -47,10 +47,11 @@ pipe = FluxControlNetPipeline.from_pretrained(
|
|
| 47 |
)
|
| 48 |
pipe.to("cuda")
|
| 49 |
|
|
|
|
| 50 |
# For FLUX models, compiling VAE decode can also be beneficial if needed, though UNet is primary.
|
| 51 |
# pipe.vae.decode = torch.compile(pipe.vae.decode, mode="reduce-overhead", fullgraph=True) # Uncomment if VAE compile helps
|
| 52 |
try:
|
| 53 |
-
pipe.vae.decode = torch.compile(pipe.vae.decode,
|
| 54 |
except Exception as e:
|
| 55 |
print(f"Compile failed: {e}")
|
| 56 |
|
|
|
|
| 23 |
import gradio as gr
|
| 24 |
from huggingface_hub import CommitScheduler, HfApi, logging
|
| 25 |
from debug import log_params, scheduler
|
| 26 |
+
import torch._dynamo
|
| 27 |
logging.set_verbosity_debug()
|
| 28 |
|
| 29 |
huggingface_token = os.getenv("HUGGINFACE_TOKEN")
|
|
|
|
| 47 |
)
|
| 48 |
pipe.to("cuda")
|
| 49 |
|
| 50 |
+
torch._dynamo.config.suppress_errors = True
|
| 51 |
# For FLUX models, compiling VAE decode can also be beneficial if needed, though UNet is primary.
|
| 52 |
# pipe.vae.decode = torch.compile(pipe.vae.decode, mode="reduce-overhead", fullgraph=True) # Uncomment if VAE compile helps
|
| 53 |
try:
|
| 54 |
+
pipe.vae.decode = torch.compile(pipe.vae.decode, mode="default")
|
| 55 |
except Exception as e:
|
| 56 |
print(f"Compile failed: {e}")
|
| 57 |
|