Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import gradio as gr
|
|
4 |
from PIL import Image
|
5 |
import os
|
6 |
import torch
|
7 |
-
from diffusers import
|
8 |
from utils.planner import extract_scene_plan # 🧠 Brain Layer
|
9 |
|
10 |
# ----------------------------
|
@@ -16,11 +16,12 @@ dtype = torch.float16 if device == "cuda" else torch.float32
|
|
16 |
# ----------------------------
|
17 |
# 📦 Load Inpainting Model
|
18 |
# ----------------------------
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
|
|
24 |
|
25 |
pipe.enable_attention_slicing()
|
26 |
pipe.enable_model_cpu_offload()
|
@@ -90,3 +91,6 @@ with gr.Blocks() as demo:
|
|
90 |
|
91 |
demo.launch()
|
92 |
|
|
|
|
|
|
|
|
4 |
from PIL import Image
|
5 |
import os
|
6 |
import torch
|
7 |
+
from diffusers import StableDiffusionInpaintPipeline
|
8 |
from utils.planner import extract_scene_plan # 🧠 Brain Layer
|
9 |
|
10 |
# ----------------------------
|
|
|
16 |
# ----------------------------
|
17 |
# 📦 Load Inpainting Model
|
18 |
# ----------------------------
|
19 |
+
|
20 |
+
|
21 |
+
pipe = StableDiffusionInpaintPipeline.from_pretrained(
|
22 |
+
"runwayml/stable-diffusion-inpainting",
|
23 |
+
torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32
|
24 |
+
).to("cuda" if torch.cuda.is_available() else "cpu")
|
25 |
|
26 |
pipe.enable_attention_slicing()
|
27 |
pipe.enable_model_cpu_offload()
|
|
|
91 |
|
92 |
demo.launch()
|
93 |
|
94 |
+
|
95 |
+
|
96 |
+
|