Fabrice-TIERCELIN
commited on
Commit
•
a7db47f
1
Parent(s):
a8bd76d
ZeroGPU
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ import time
|
|
4 |
import math
|
5 |
import random
|
6 |
import torch
|
|
|
7 |
|
8 |
from diffusers import AutoPipelineForImage2Image
|
9 |
from PIL import Image, ImageFilter
|
@@ -51,6 +52,7 @@ def check(
|
|
51 |
if prompt is None or prompt == "":
|
52 |
raise gr.Error("Please provide a prompt input.")
|
53 |
|
|
|
54 |
def redraw(
|
55 |
source_img,
|
56 |
prompt,
|
@@ -192,7 +194,8 @@ with gr.Blocks() as interface:
|
|
192 |
<li>To modify <b>anything else</b> on your image, I recommend to use <i>Instruct Pix2Pix</i>.</li>
|
193 |
</ul>
|
194 |
<br/>
|
195 |
-
|
|
|
196 |
<a href='https://huggingface.co/spaces/Fabrice-TIERCELIN/Image-to-Image?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'></a>
|
197 |
<br/>
|
198 |
⚖️ You can use, modify and share the generated images but not for commercial uses.
|
|
|
4 |
import math
|
5 |
import random
|
6 |
import torch
|
7 |
+
import spaces
|
8 |
|
9 |
from diffusers import AutoPipelineForImage2Image
|
10 |
from PIL import Image, ImageFilter
|
|
|
52 |
if prompt is None or prompt == "":
|
53 |
raise gr.Error("Please provide a prompt input.")
|
54 |
|
55 |
+
@spaces.GPU(duration=420)
|
56 |
def redraw(
|
57 |
source_img,
|
58 |
prompt,
|
|
|
194 |
<li>To modify <b>anything else</b> on your image, I recommend to use <i>Instruct Pix2Pix</i>.</li>
|
195 |
</ul>
|
196 |
<br/>
|
197 |
+
""" + ("🏃♀️ Estimated time: few minutes." if torch.cuda.is_available() else "🐌 Slow process... ~2 hours.") + """
|
198 |
+
Your computer must <u>not</u> enter into standby mode.<br/>You can duplicate this space on a free account, it's designed to work on CPU, GPU and ZeroGPU.<br/>
|
199 |
<a href='https://huggingface.co/spaces/Fabrice-TIERCELIN/Image-to-Image?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'></a>
|
200 |
<br/>
|
201 |
⚖️ You can use, modify and share the generated images but not for commercial uses.
|