Spaces:
Running
Running
yizhangliu
commited on
Commit
•
fc4f76a
1
Parent(s):
bb01b85
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,6 @@ import torch
|
|
8 |
from torch import autocast
|
9 |
import cv2
|
10 |
|
11 |
-
'''
|
12 |
from io import BytesIO
|
13 |
import requests
|
14 |
import PIL
|
@@ -192,7 +191,7 @@ model = ModelManager(
|
|
192 |
# sd_run_local=True,
|
193 |
# callback=diffuser_callback,
|
194 |
)
|
195 |
-
|
196 |
|
197 |
'''
|
198 |
pipe = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-inpainting", dtype=torch.float16, revision="fp16", use_auth_token=auth_token).to(device)
|
@@ -289,7 +288,6 @@ image_blocks = gr.Interface(
|
|
289 |
image_blocks.launch(inline=True)
|
290 |
|
291 |
import gradio as gr
|
292 |
-
'''
|
293 |
|
294 |
def greet(dict, name, is_morning, temperature):
|
295 |
image = dict['image']
|
@@ -308,18 +306,16 @@ demo = gr.Interface(
|
|
308 |
outputs=['image', "text", "number"],
|
309 |
)
|
310 |
demo.launch()
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
'''
|
|
|
315 |
image_blocks = gr.Blocks(css=css)
|
316 |
with image_blocks as demo:
|
317 |
-
gr.HTML(read_content("header.html"))
|
318 |
with gr.Group():
|
319 |
with gr.Box():
|
320 |
with gr.Row():
|
321 |
with gr.Column():
|
322 |
-
image = gr.Image(source='upload', tool='sketch', elem_id="image_upload",
|
323 |
with gr.Row(elem_id="prompt-container").style(mobile_collapse=False, equal_height=True):
|
324 |
prompt = gr.Textbox(placeholder = 'Your prompt (what you want in place of what is erased)', show_label=False, elem_id="input-text")
|
325 |
btn = gr.Button("Done!").style(
|
@@ -354,5 +350,4 @@ with image_blocks as demo:
|
|
354 |
"""
|
355 |
)
|
356 |
|
357 |
-
image_blocks.launch(
|
358 |
-
'''
|
|
|
8 |
from torch import autocast
|
9 |
import cv2
|
10 |
|
|
|
11 |
from io import BytesIO
|
12 |
import requests
|
13 |
import PIL
|
|
|
191 |
# sd_run_local=True,
|
192 |
# callback=diffuser_callback,
|
193 |
)
|
194 |
+
|
195 |
|
196 |
'''
|
197 |
pipe = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-inpainting", dtype=torch.float16, revision="fp16", use_auth_token=auth_token).to(device)
|
|
|
288 |
image_blocks.launch(inline=True)
|
289 |
|
290 |
import gradio as gr
|
|
|
291 |
|
292 |
def greet(dict, name, is_morning, temperature):
|
293 |
image = dict['image']
|
|
|
306 |
outputs=['image', "text", "number"],
|
307 |
)
|
308 |
demo.launch()
|
|
|
|
|
|
|
309 |
'''
|
310 |
+
|
311 |
image_blocks = gr.Blocks(css=css)
|
312 |
with image_blocks as demo:
|
313 |
+
# gr.HTML(read_content("header.html"))
|
314 |
with gr.Group():
|
315 |
with gr.Box():
|
316 |
with gr.Row():
|
317 |
with gr.Column():
|
318 |
+
image = gr.Image(source='upload', tool='sketch', elem_id="image_upload", label="Upload") #.style(height=400)
|
319 |
with gr.Row(elem_id="prompt-container").style(mobile_collapse=False, equal_height=True):
|
320 |
prompt = gr.Textbox(placeholder = 'Your prompt (what you want in place of what is erased)', show_label=False, elem_id="input-text")
|
321 |
btn = gr.Button("Done!").style(
|
|
|
350 |
"""
|
351 |
)
|
352 |
|
353 |
+
image_blocks.launch()
|
|