Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
import torch
|
|
|
3 |
from diffusers import StableDiffusionInpaintPipeline
|
4 |
|
5 |
# Load the Stable Diffusion inpainting model
|
@@ -14,6 +15,10 @@ def load_inpainting_model():
|
|
14 |
|
15 |
# Function to edit the clothing image based on prompt
|
16 |
def edit_clothing_image(prompt, image):
|
|
|
|
|
|
|
|
|
17 |
# Load the model
|
18 |
model = load_inpainting_model()
|
19 |
|
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
+
from PIL import Image
|
4 |
from diffusers import StableDiffusionInpaintPipeline
|
5 |
|
6 |
# Load the Stable Diffusion inpainting model
|
|
|
15 |
|
16 |
# Function to edit the clothing image based on prompt
|
17 |
def edit_clothing_image(prompt, image):
|
18 |
+
# Ensure the image is in PIL format
|
19 |
+
if isinstance(image, np.ndarray):
|
20 |
+
image = Image.fromarray(image)
|
21 |
+
|
22 |
# Load the model
|
23 |
model = load_inpainting_model()
|
24 |
|