Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -105,12 +105,6 @@ apply_hed = HEDdetector()
|
|
105 |
def main():
|
106 |
lottie_penguin = load_lottieurl('https://assets5.lottiefiles.com/datafiles/B8q1AyJ5t1wb5S8a2ggTqYNxS1WiKN9mjS76TBpw/articulation/articulation.json')
|
107 |
st.header('Draw and generate image with ControlNet')
|
108 |
-
st.markdown('''
|
109 |
-
##### Step 1a. Draw your image with canvas
|
110 |
-
##### Step 1b. You also can upload image directly by select Upload in side bar
|
111 |
-
##### Step 2. Input prompt to instruct model (You can also change some config with advanced option if need)
|
112 |
-
##### Step 3. Generate and enjoy
|
113 |
-
''')
|
114 |
with st.sidebar:
|
115 |
st_lottie(lottie_penguin, height=200)
|
116 |
choose = option_menu("Generate image", ["Canvas", "Upload"],
|
@@ -140,6 +134,7 @@ def main():
|
|
140 |
unsafe_allow_html=True,
|
141 |
)
|
142 |
if choose == 'Upload':
|
|
|
143 |
with st.form(key='generate_form'):
|
144 |
upload_file = st.file_uploader("Upload image", type=["png", "jpg", "jpeg"])
|
145 |
prompt = st.text_input(label="Prompt", placeholder='Type your instruction')
|
@@ -177,6 +172,12 @@ def main():
|
|
177 |
col12.image(output_image, channels='RGB', width=None, clamp=False, caption='Generated image')
|
178 |
|
179 |
elif choose == 'Canvas':
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
with st.form(key='canvas_generate_form'):
|
181 |
|
182 |
# Specify canvas parameters in application
|
|
|
105 |
def main():
|
106 |
lottie_penguin = load_lottieurl('https://assets5.lottiefiles.com/datafiles/B8q1AyJ5t1wb5S8a2ggTqYNxS1WiKN9mjS76TBpw/articulation/articulation.json')
|
107 |
st.header('Draw and generate image with ControlNet')
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
with st.sidebar:
|
109 |
st_lottie(lottie_penguin, height=200)
|
110 |
choose = option_menu("Generate image", ["Canvas", "Upload"],
|
|
|
134 |
unsafe_allow_html=True,
|
135 |
)
|
136 |
if choose == 'Upload':
|
137 |
+
st.info("Upload your own image, fill the prompt and enjoy")
|
138 |
with st.form(key='generate_form'):
|
139 |
upload_file = st.file_uploader("Upload image", type=["png", "jpg", "jpeg"])
|
140 |
prompt = st.text_input(label="Prompt", placeholder='Type your instruction')
|
|
|
172 |
col12.image(output_image, channels='RGB', width=None, clamp=False, caption='Generated image')
|
173 |
|
174 |
elif choose == 'Canvas':
|
175 |
+
st.markdown('''
|
176 |
+
###### Step 1a. Draw your image with canvas
|
177 |
+
###### Step 1b. You also can upload image directly by select Upload in side bar
|
178 |
+
###### Step 2. Input prompt to instruct model (You can also change some config with advanced option if need)
|
179 |
+
###### Step 3. Generate and enjoy
|
180 |
+
''')
|
181 |
with st.form(key='canvas_generate_form'):
|
182 |
|
183 |
# Specify canvas parameters in application
|