Fabrice-TIERCELIN
commited on
ZeroGPU
Browse files
app.py
CHANGED
@@ -6,6 +6,7 @@ import math
|
|
6 |
import random
|
7 |
import imageio
|
8 |
import torch
|
|
|
9 |
|
10 |
from diffusers import (
|
11 |
ControlNetModel,
|
@@ -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 pix2pix(
|
55 |
input_image,
|
56 |
prompt,
|
@@ -165,7 +167,8 @@ with gr.Blocks() as interface:
|
|
165 |
<li>To make a <b>tile</b> of your image, I recommend to use <i>Make My Image Tile</i>,</li>
|
166 |
</ul>
|
167 |
<br/>
|
168 |
-
|
|
|
169 |
<a href='https://huggingface.co/spaces/Fabrice-TIERCELIN/Instruct-Pix2Pix?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>
|
170 |
<br/>
|
171 |
⚖️ You can use, modify and share the generated images but not for commercial uses.
|
|
|
6 |
import random
|
7 |
import imageio
|
8 |
import torch
|
9 |
+
import spaces
|
10 |
|
11 |
from diffusers import (
|
12 |
ControlNetModel,
|
|
|
52 |
if prompt is None or prompt == "":
|
53 |
raise gr.Error("Please provide a prompt input.")
|
54 |
|
55 |
+
@spaces.GPU(duration=420)
|
56 |
def pix2pix(
|
57 |
input_image,
|
58 |
prompt,
|
|
|
167 |
<li>To make a <b>tile</b> of your image, I recommend to use <i>Make My Image Tile</i>,</li>
|
168 |
</ul>
|
169 |
<br/>
|
170 |
+
""" + ("🏃♀️ Estimated time: few minutes." if torch.cuda.is_available() else "🐌 Slow process... ~1 hour.") + """
|
171 |
+
Your computer must not enter into standby mode. You can launch several generations in different browser tabs when you're gone. If this space does not work or you want a faster run, use <i>Instruct Pix2Pix</i> available on terrapretapermaculture's <i>ControlNet-v1-1</i> space (last tab) or on <i>Dezgo</i> site.<br>You can duplicate this space on a free account, it's designed to work on CPU, GPU and ZeroGPU.<br/>
|
172 |
<a href='https://huggingface.co/spaces/Fabrice-TIERCELIN/Instruct-Pix2Pix?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>
|
173 |
<br/>
|
174 |
⚖️ You can use, modify and share the generated images but not for commercial uses.
|