Manireddy1508 commited on
Commit
b2ef34b
·
verified ·
1 Parent(s): 0f81008

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -6
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 StableDiffusionXLInpaintPipeline
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
- pipe = StableDiffusionXLInpaintPipeline.from_pretrained(
20
- "diffusers/stable-diffusion-xl-1.0-inpainting",
21
- torch_dtype=dtype,
22
- variant="fp16" if device == "cuda" else None
23
- ).to(device)
 
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
+