Spaces:
Running
on
A10G
Running
on
A10G
Linoy Tsaban
commited on
Commit
•
7f61c74
1
Parent(s):
5c65e56
Update app.py
Browse files
app.py
CHANGED
@@ -51,7 +51,20 @@ sd_pipe = StableDiffusionPipeline.from_pretrained(sd_model_id).to(device)
|
|
51 |
sd_pipe.scheduler = DDIMScheduler.from_config(sd_model_id, subfolder = "scheduler")
|
52 |
sem_pipe = SemanticStableDiffusionPipeline.from_pretrained(sd_model_id).to(device)
|
53 |
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
def edit(input_image,
|
56 |
src_prompt ="",
|
57 |
tar_prompt="",
|
@@ -168,6 +181,13 @@ with gr.Blocks() as demo:
|
|
168 |
outputs=[ddpm_edited_image, sega_edited_image],
|
169 |
)
|
170 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
|
172 |
|
173 |
demo.queue()
|
|
|
51 |
sd_pipe.scheduler = DDIMScheduler.from_config(sd_model_id, subfolder = "scheduler")
|
52 |
sem_pipe = SemanticStableDiffusionPipeline.from_pretrained(sd_model_id).to(device)
|
53 |
|
54 |
+
cache_examples = True
|
55 |
+
|
56 |
+
def get_example():
|
57 |
+
case = [
|
58 |
+
[
|
59 |
+
'examples/.jpg',
|
60 |
+
'',
|
61 |
+
'',
|
62 |
+
'',
|
63 |
+
'examples/.png',
|
64 |
+
'examples/.png'
|
65 |
+
]]
|
66 |
+
return case
|
67 |
+
|
68 |
def edit(input_image,
|
69 |
src_prompt ="",
|
70 |
tar_prompt="",
|
|
|
181 |
outputs=[ddpm_edited_image, sega_edited_image],
|
182 |
)
|
183 |
|
184 |
+
# gr.Examples(
|
185 |
+
# label='Examples',
|
186 |
+
# examples=get_example(),
|
187 |
+
# inputs=[img_input, src_prompt, tar_prompt, edit_concept,
|
188 |
+
# ddpm_output, ddpm_sega_output],
|
189 |
+
# outputs=[img_output])
|
190 |
+
|
191 |
|
192 |
|
193 |
demo.queue()
|