Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,10 +1,11 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import torch
|
| 3 |
-
from diffusers import
|
| 4 |
from PIL import Image
|
| 5 |
|
| 6 |
# Load the diffusion model
|
| 7 |
-
|
|
|
|
| 8 |
|
| 9 |
# Set the model to the appropriate device
|
| 10 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import torch
|
| 3 |
+
from diffusers import FluxPipeline
|
| 4 |
from PIL import Image
|
| 5 |
|
| 6 |
# Load the diffusion model
|
| 7 |
+
pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
|
| 8 |
+
pipe.enable_model_cpu_offload() #save some VRAM by offloading the model to CPU. Remove this if you have enough GPU power
|
| 9 |
|
| 10 |
# Set the model to the appropriate device
|
| 11 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|