Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,9 +5,6 @@ import spaces
|
|
| 5 |
import torch
|
| 6 |
import time
|
| 7 |
from diffusers import DiffusionPipeline, AutoencoderTiny
|
| 8 |
-
# Using AttnProcessor2_0 for potential speedup with PyTorch 2.x
|
| 9 |
-
from diffusers.models.attention_processor import AttnProcessor2_0
|
| 10 |
-
# Assuming custom_pipeline defines FluxWithCFGPipeline correctly
|
| 11 |
from custom_pipeline import FluxWithCFGPipeline
|
| 12 |
|
| 13 |
# --- Torch Optimizations ---
|
|
@@ -36,8 +33,6 @@ pipe.vae = AutoencoderTiny.from_pretrained("madebyollin/taef1", torch_dtype=dtyp
|
|
| 36 |
pipe.to(device)
|
| 37 |
|
| 38 |
# Apply optimizations
|
| 39 |
-
pipe.vae.set_attn_processor(AttnProcessor2_0()) # VAE might benefit too
|
| 40 |
-
|
| 41 |
pipe.load_lora_weights('hugovntr/flux-schnell-realism', weight_name='schnell-realism_v2.3.safetensors', adapter_name="better")
|
| 42 |
pipe.set_adapters(["better"], adapter_weights=[1.0])
|
| 43 |
pipe.fuse_lora(adapter_name=["better"], lora_scale=1.0) # Fuse for potential speedup
|
|
|
|
| 5 |
import torch
|
| 6 |
import time
|
| 7 |
from diffusers import DiffusionPipeline, AutoencoderTiny
|
|
|
|
|
|
|
|
|
|
| 8 |
from custom_pipeline import FluxWithCFGPipeline
|
| 9 |
|
| 10 |
# --- Torch Optimizations ---
|
|
|
|
| 33 |
pipe.to(device)
|
| 34 |
|
| 35 |
# Apply optimizations
|
|
|
|
|
|
|
| 36 |
pipe.load_lora_weights('hugovntr/flux-schnell-realism', weight_name='schnell-realism_v2.3.safetensors', adapter_name="better")
|
| 37 |
pipe.set_adapters(["better"], adapter_weights=[1.0])
|
| 38 |
pipe.fuse_lora(adapter_name=["better"], lora_scale=1.0) # Fuse for potential speedup
|