Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,17 +1,19 @@
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
-
from diffusers import
|
4 |
from PIL import Image
|
5 |
from typing import List
|
6 |
#StableDiffusionImg2ImgPipeline
|
7 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
8 |
-
model_id = "
|
9 |
|
10 |
-
pipe =
|
11 |
model_id,
|
12 |
torch_dtype=torch.float16 if device == "cuda" else torch.float32,
|
13 |
safety_checker=None
|
14 |
).to(device)
|
|
|
|
|
15 |
pipe.enable_attention_slicing()
|
16 |
|
17 |
styles = {
|
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
+
from diffusers import AutoPipelineForImage2Image
|
4 |
from PIL import Image
|
5 |
from typing import List
|
6 |
#StableDiffusionImg2ImgPipeline
|
7 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
8 |
+
model_id = "black-forest-labs/FLUX.1-dev"
|
9 |
|
10 |
+
pipe = AutoPipelineForImage2Image.from_pretrained(
|
11 |
model_id,
|
12 |
torch_dtype=torch.float16 if device == "cuda" else torch.float32,
|
13 |
safety_checker=None
|
14 |
).to(device)
|
15 |
+
|
16 |
+
pipe.load_lora_weights("openfree/flux-chatgpt-ghibli-lora")
|
17 |
pipe.enable_attention_slicing()
|
18 |
|
19 |
styles = {
|