Spaces:
Running
Running
comdoleger
commited on
Commit
•
c545b69
1
Parent(s):
3987e25
Update app.py
Browse files
app.py
CHANGED
@@ -55,7 +55,7 @@ def process(data, api, api_key):
|
|
55 |
print(f"An error occurred: {e}")
|
56 |
status = run_request.status()
|
57 |
if status=="FAILED":
|
58 |
-
raise gr.Error("An error occured 💥!", duration=5)
|
59 |
if status=="TIMED_OUT":
|
60 |
raise gr.Error("Sorry we could not secure a worker for you ⏳! Try again", duration=5)
|
61 |
|
@@ -68,7 +68,7 @@ def process(data, api, api_key):
|
|
68 |
|
69 |
return image
|
70 |
|
71 |
-
def process_generate(fore, prompt, image_width, image_height, intensity, mode, refprompt):
|
72 |
|
73 |
size = fore.size
|
74 |
if size[0]*size[1]<=(768*768):
|
@@ -162,10 +162,17 @@ with block:
|
|
162 |
label="Generation Mode", type='value')
|
163 |
mode.change(fn=update_value, inputs=mode, outputs=mode)
|
164 |
with gr.Column():
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
|
170 |
with gr.Row():
|
171 |
intensity = gr.Slider(label="Refiner Strength", minimum=1.0, maximum=7.0, value=3.0, step=0.5)
|
@@ -175,7 +182,7 @@ with block:
|
|
175 |
|
176 |
|
177 |
|
178 |
-
ips = [fore, prompt, image_width, image_height, intensity, mode, refprompt]
|
179 |
generate_button.click(fn=process_generate, inputs=ips, outputs=[result_gallery])
|
180 |
|
181 |
|
|
|
55 |
print(f"An error occurred: {e}")
|
56 |
status = run_request.status()
|
57 |
if status=="FAILED":
|
58 |
+
raise gr.Error(f"An error occured 💥! {e}", duration=5)
|
59 |
if status=="TIMED_OUT":
|
60 |
raise gr.Error("Sorry we could not secure a worker for you ⏳! Try again", duration=5)
|
61 |
|
|
|
68 |
|
69 |
return image
|
70 |
|
71 |
+
def process_generate(fore, prompt, image_width, image_height, intensity, mode, refprompt, bg):
|
72 |
|
73 |
size = fore.size
|
74 |
if size[0]*size[1]<=(768*768):
|
|
|
162 |
label="Generation Mode", type='value')
|
163 |
mode.change(fn=update_value, inputs=mode, outputs=mode)
|
164 |
with gr.Column():
|
165 |
+
bg = gr.Checkbox(info="Remove Backgroung")
|
166 |
+
bg.change(fn=update_value, inputs=bg, outputs=bg)
|
167 |
+
|
168 |
+
with gr.Column():
|
169 |
+
gr.HTML('''
|
170 |
+
<div>
|
171 |
+
<a style="display:inline-block; margin-left: .5em" href="https://app.fotographer.ai/home"><img src="https://img.shields.io/badge/2310.15110-f9f7f7?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADcAAABMCAYAAADJPi9EAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAuIwAALiMBeKU/dgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAa2SURBVHja3Zt7bBRFGMAXUCDGF4rY7m7bAwuhlggKStFgLBgFEkCIIRJEEoOBYHwRFYKilUgEReVNJEGCJJpehHI3M9vZvd3bUP1DjNhEIRQQsQgSHiJgQZ5dv7krWEvvdmZ7d7vHJN+ft/f99pv5XvOtJMFCqvoCUpTdIEeRLC+L9Ox5i3Q9LACaCeK0kXoSChVcD3C/tQPHpAEsquQ73IkUcEz2kcLCknyGW5MGjkljRFVL8xJOKyi4CwCOuQAeAkfTP1+tNxLkogvgEbDgffkJqKqvuMA5ifOpqg/5qWecRstNg7xoUTI1Fovdxg8oy2s5AP8CGeYHmGngeZaOL4I4LXLcpHg4149/GDz4xqgsb+UAbMKKUpkrqHA43MUyyJpWUK0EHeG2YKRXr7tB+QMcgGewLD+ebTDbtrtbBt7UPlhS4rV4IvcDI7J8P1OeA/AcAI7LHljN7aB8XTowJmZt9EFRD/o0SDMH4HlwMhMyDWZZSAHFf3YDs3RS49WDLuaAY3IJq+qzmQKLxXAZKN7oDoYbdV3v5elPqiSpMyiOuAEVZVqHXb1OhloUH+MA+ztO0cAO/RkrfyBE7OAEbAZvO8vzVtTRWFD6DAfY5biBM3PWiaL0a4lvXIC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XJZBt9IQh42NY0NSdgbLIPlLUF6rEdrdt0CUCK1wsCbkcI3ZSLc7ZSwGLbmJXbPsNxnE5xilYKAobZ77LpGZ8TAIun+/iCKQoF71IxQDI3K2CCd+ARNvXg9sykBcnHAoCZG4u66hlDoQLe6QV4CRtFSxZQ+D0BwNO2jgdkzoGoah1nj3FVlSR19taTSYxI8QLut23U8dsgzqHulJNCQpcqBnpTALCuQ6NSYLHpmR5i42gZzuIdcrMMvMJbQlxe3jXxyZnLACl7ARm/FjPIDOY8ODtpM71sxwfcZpvBeUzKWmfNINM5AS+wO0Khh7dMqKccu4+qatarZjYAwDlgetzStHtEt+XedsBOQtU9XMrRgjg4KTnc5nr+dmqadit/4C4uLm8DuA9koJTj1TL7fI5nDL+qqoo/FLGAzL7dYT17PzvAcQONYSUQRxW/QMrHZVIyik0ZuQA2mzp+Ji8BW4YM3Mbzm9inaHkJCGfrUZZjujiYailfFwA8DHIy3acwUj4v9vUVa+SmgNsl5fuyDTKovW9/IAmfLV0Pi2UncA515kjYdrwC9i9rpuHiq3JwtAAAAABJRU5ErkJggg=="></a>
|
172 |
+
<a style="display:inline-block; margin-left: .5em" href='https://app.fotographer.ai/home'><img src='https://img.shields.io/github/stars/SUDO-AI-3D/zero123plus?style=social' /></a>
|
173 |
+
Check out our App<a href="https://app.fotographer.ai/home">Fotographer.ai</a>!
|
174 |
+
</div>
|
175 |
+
''')
|
176 |
|
177 |
with gr.Row():
|
178 |
intensity = gr.Slider(label="Refiner Strength", minimum=1.0, maximum=7.0, value=3.0, step=0.5)
|
|
|
182 |
|
183 |
|
184 |
|
185 |
+
ips = [fore, prompt, image_width, image_height, intensity, mode, refprompt, bg]
|
186 |
generate_button.click(fn=process_generate, inputs=ips, outputs=[result_gallery])
|
187 |
|
188 |
|