Spaces:
Runtime error
Runtime error
update
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
| 2 |
|
| 3 |
import torch
|
| 4 |
from transformers import AutoImageProcessor, Mask2FormerForUniversalSegmentation
|
|
@@ -18,5 +19,16 @@ pipe = StableDiffusionInpaintPipeline.from_pretrained(
|
|
| 18 |
).to(device)
|
| 19 |
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
x = st.slider('Select a value')
|
| 22 |
st.write(x, 'squared is', x * x)
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from PIL import Image
|
| 3 |
|
| 4 |
import torch
|
| 5 |
from transformers import AutoImageProcessor, Mask2FormerForUniversalSegmentation
|
|
|
|
| 19 |
).to(device)
|
| 20 |
|
| 21 |
|
| 22 |
+
st.title("Stable Edit - Edit your photos with Stable Diffusion!")
|
| 23 |
+
|
| 24 |
+
# upload image
|
| 25 |
+
filename = st.file_uploader("upload an image")
|
| 26 |
+
image = Image.open(filename)
|
| 27 |
+
st.image(image)
|
| 28 |
+
|
| 29 |
+
# Select Area to edit
|
| 30 |
+
st.selectbox("Options", ("AutoSegment Area", "Draw Custom Area"))
|
| 31 |
+
|
| 32 |
+
# TEMP - DEMO stuff
|
| 33 |
x = st.slider('Select a value')
|
| 34 |
st.write(x, 'squared is', x * x)
|