Update app.py
Browse files
app.py
CHANGED
@@ -33,7 +33,7 @@ def infer(prompt, init_image):
|
|
33 |
num_inference_steps=50,
|
34 |
generator=generator,
|
35 |
text_embedding_optimization_steps=500,
|
36 |
-
model_fine_tuning_optimization_steps=
|
37 |
|
38 |
with torch.no_grad():
|
39 |
torch.cuda.empty_cache()
|
@@ -68,8 +68,11 @@ title = """
|
|
68 |
<br /><img src="https://user-images.githubusercontent.com/788417/196388568-4ee45edd-e990-452c-899f-c25af32939be.png" style="margin:7px 0 20px;"/>
|
69 |
|
70 |
<p style="font-size: 94%">
|
71 |
-
You can skip the queue by duplicating this space:
|
72 |
-
<
|
|
|
|
|
|
|
73 |
</p>
|
74 |
|
75 |
</div>
|
@@ -121,8 +124,8 @@ with gr.Blocks(css=css) as block:
|
|
121 |
image_output = gr.Image(label="Edited image")
|
122 |
|
123 |
examples=[['a sitting dog','imagic-dog.png'], ['a photo of a bird spreading wings','imagic-bird.png']]
|
124 |
-
ex = gr.Examples(examples=examples, fn=infer, inputs=[prompt_input,image_init], outputs=[image_output], cache_examples=
|
125 |
-
|
126 |
|
127 |
gr.HTML(article)
|
128 |
|
|
|
33 |
num_inference_steps=50,
|
34 |
generator=generator,
|
35 |
text_embedding_optimization_steps=500,
|
36 |
+
model_fine_tuning_optimization_steps=500)
|
37 |
|
38 |
with torch.no_grad():
|
39 |
torch.cuda.empty_cache()
|
|
|
68 |
<br /><img src="https://user-images.githubusercontent.com/788417/196388568-4ee45edd-e990-452c-899f-c25af32939be.png" style="margin:7px 0 20px;"/>
|
69 |
|
70 |
<p style="font-size: 94%">
|
71 |
+
You can skip the queue by duplicating this space or run the Colab version:
|
72 |
+
<span style="display: flex;align-items: center;justify-content: center;height: 30px;">
|
73 |
+
<a href="https://huggingface.co/spaces/fffiloni/imagic-stable-diffusion?duplicate=true"><img src="https://img.shields.io/badge/-Duplicate%20Space-blue?labelColor=white&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAP5JREFUOE+lk7FqAkEURY+ltunEgFXS2sZGIbXfEPdLlnxJyDdYB62sbbUKpLbVNhyYFzbrrA74YJlh9r079973psed0cvUD4A+4HoCjsA85X0Dfn/RBLBgBDxnQPfAEJgBY+A9gALA4tcbamSzS4xq4FOQAJgCDwV2CPKV8tZAJcAjMMkUe1vX+U+SMhfAJEHasQIWmXNN3abzDwHUrgcRGmYcgKe0bxrblHEB4E/pndMazNpSZGcsZdBlYJcEL9Afo75molJyM2FxmPgmgPqlWNLGfwZGG6UiyEvLzHYDmoPkDDiNm9JR9uboiONcBXrpY1qmgs21x1QwyZcpvxt9NS09PlsPAAAAAElFTkSuQmCC&logoWidth=14" alt="Duplicate Space"></a>
|
74 |
+
<a href="https://colab.research.google.com/github/ShivamShrirao/diffusers/blob/main/examples/imagic/Imagic_Stable_Diffusion.ipynb"><img data-canonical-src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab" src="https://camo.githubusercontent.com/84f0493939e0c4de4e6dbe113251b4bfb5353e57134ffd9fcab6b8714514d4d1/68747470733a2f2f636f6c61622e72657365617263682e676f6f676c652e636f6d2f6173736574732f636f6c61622d62616467652e737667"></a>
|
75 |
+
</span>
|
76 |
</p>
|
77 |
|
78 |
</div>
|
|
|
124 |
image_output = gr.Image(label="Edited image")
|
125 |
|
126 |
examples=[['a sitting dog','imagic-dog.png'], ['a photo of a bird spreading wings','imagic-bird.png']]
|
127 |
+
ex = gr.Examples(examples=examples, fn=infer, inputs=[prompt_input,image_init], outputs=[image_output], cache_examples=True, run_on_click=False)
|
128 |
+
|
129 |
|
130 |
gr.HTML(article)
|
131 |
|