Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
import streamlit as st
|
2 |
from PIL import Image
|
3 |
|
4 |
-
import torch
|
5 |
-
from transformers import AutoImageProcessor, Mask2FormerForUniversalSegmentation
|
6 |
-
from diffusers import StableDiffusionInpaintPipeline
|
7 |
|
8 |
|
9 |
-
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
10 |
|
11 |
-
seg_processor = AutoImageProcessor.from_pretrained("facebook/mask2former-swin-base-coco-panoptic")
|
12 |
-
seg_model = Mask2FormerForUniversalSegmentation.from_pretrained("facebook/mask2former-swin-base-coco-panoptic")
|
13 |
|
14 |
|
15 |
-
# get Stable Diffusion model for image inpainting
|
16 |
-
pipe = StableDiffusionInpaintPipeline.from_pretrained(
|
17 |
-
|
18 |
-
|
19 |
-
).to(device)
|
20 |
|
21 |
|
22 |
st.title("Stable Edit - Edit your photos with Stable Diffusion!")
|
|
|
1 |
import streamlit as st
|
2 |
from PIL import Image
|
3 |
|
4 |
+
# import torch
|
5 |
+
# from transformers import AutoImageProcessor, Mask2FormerForUniversalSegmentation
|
6 |
+
# from diffusers import StableDiffusionInpaintPipeline
|
7 |
|
8 |
|
9 |
+
# device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
10 |
|
11 |
+
# seg_processor = AutoImageProcessor.from_pretrained("facebook/mask2former-swin-base-coco-panoptic")
|
12 |
+
# seg_model = Mask2FormerForUniversalSegmentation.from_pretrained("facebook/mask2former-swin-base-coco-panoptic")
|
13 |
|
14 |
|
15 |
+
# # get Stable Diffusion model for image inpainting
|
16 |
+
# pipe = StableDiffusionInpaintPipeline.from_pretrained(
|
17 |
+
# "runwayml/stable-diffusion-inpainting",
|
18 |
+
# torch_dtype=torch.float16,
|
19 |
+
# ).to(device)
|
20 |
|
21 |
|
22 |
st.title("Stable Edit - Edit your photos with Stable Diffusion!")
|