Spaces:
Runtime error
Runtime error
Commit
Β·
096c8a3
1
Parent(s):
bb77239
Re-add artbot tab after dependency crashes fixed
Browse files
app.py
CHANGED
@@ -17,8 +17,7 @@
|
|
17 |
# add myst training
|
18 |
# add coin training
|
19 |
# add zodiac coin training
|
20 |
-
#
|
21 |
-
# attempt to redploy after crash 2
|
22 |
|
23 |
# ----- General Setup -----------------------------------------------------------------
|
24 |
|
@@ -409,6 +408,46 @@ with gr.Blocks() as beta:
|
|
409 |
|
410 |
|
411 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
412 |
# ----- Canny Edge Tab -----------------------------------------------------------------
|
413 |
|
414 |
from PIL import Image
|
@@ -821,6 +860,6 @@ with gr.Blocks() as depth_controlnet_gradio:
|
|
821 |
|
822 |
# ----- Launch Tabs -----------------------------------------------------------------
|
823 |
|
824 |
-
tabbed_interface = gr.TabbedInterface([new_welcome, advanced_tab, beta, canny_blocks_interface, depth_controlnet_gradio], ["
|
825 |
# tabbed_interface = gr.TabbedInterface([new_welcome, advanced_tab, beta], ["Artbots", "Advanced", "Beta"])
|
826 |
tabbed_interface.launch()
|
|
|
17 |
# add myst training
|
18 |
# add coin training
|
19 |
# add zodiac coin training
|
20 |
+
# readding artbot tab after dependency crashes fixed
|
|
|
21 |
|
22 |
# ----- General Setup -----------------------------------------------------------------
|
23 |
|
|
|
408 |
|
409 |
|
410 |
|
411 |
+
# ----- Artbot Tab -----------------------------------------------------------------
|
412 |
+
|
413 |
+
import random
|
414 |
+
|
415 |
+
with gr.Blocks(css=".gradio-container {max-width: 650px}") as artbot_1:
|
416 |
+
gr.Markdown('''
|
417 |
+
# <span style="display: inline-block; height: 30px; width: 30px; margin-bottom: -3px; border-radius: 7px; background-size: 50px; background-position: center; background-image: url(http://www.astronaut.horse/thumbnail.jpg)"></span> Astronaut Horse
|
418 |
+
|
419 |
+
These images are generated in real time by a generative machine learning model fine-tuned on input artworks chosen by collaborating visual artists. The hardware resources to run this process have been generously provided at no cost by Hugging Face via a Community GPU Grant. For full control over all input parameters see the other tabs on this application. For more images and information on the project see the main project page or the discord community linked below. The images you generate here are not recorded unless you save them, they belong to everyone and no one.
|
420 |
+
<br><br>
|
421 |
+
<a href="http://www.astronaut.horse">http://www.astronaut.horse</a>
|
422 |
+
<br>
|
423 |
+
<a href="https://discord.gg/ZctfW4SvGw">https://discord.com</a><br>
|
424 |
+
''')
|
425 |
+
|
426 |
+
# with gr.Row():
|
427 |
+
# dropdown = gr.Dropdown([dropdown for dropdown in list(DROPDOWNS) if 'ahx-model' in dropdown], label="choose style...")
|
428 |
+
# size_dropdown = gr.Dropdown(['square', 'portrait', 'landscape'], label="choose size...")
|
429 |
+
# prompt = gr.Textbox(label="image prompt...", elem_id="input-text")
|
430 |
+
|
431 |
+
all_models = [dropdown for dropdown in list(DROPDOWNS) if 'ahx-' in dropdown]
|
432 |
+
model_1 = random.choice(all_models)
|
433 |
+
model_2 = random.choice(all_models)
|
434 |
+
|
435 |
+
prompt = f"{model_1} {model_2}"
|
436 |
+
|
437 |
+
seed = random_seed()
|
438 |
+
|
439 |
+
go_button = gr.Button("generate image", elem_id="go-button")
|
440 |
+
output = gr.Image(elem_id="output-image")
|
441 |
+
output_text = gr.Text(elem_id="output-text")
|
442 |
+
# go_button.click(fn=simple_image_prompt, inputs=[prompt, dropdown, size_dropdown], outputs=[output, output_text])
|
443 |
+
go_button.click(fn=image_prompt, inputs=[prompt, 7.5, 30, seed, 768, 768, ""], outputs=[output, output_text])
|
444 |
+
|
445 |
+
|
446 |
+
|
447 |
+
|
448 |
+
|
449 |
+
|
450 |
+
|
451 |
# ----- Canny Edge Tab -----------------------------------------------------------------
|
452 |
|
453 |
from PIL import Image
|
|
|
860 |
|
861 |
# ----- Launch Tabs -----------------------------------------------------------------
|
862 |
|
863 |
+
tabbed_interface = gr.TabbedInterface([artbot_1, new_welcome, advanced_tab, beta, canny_blocks_interface, depth_controlnet_gradio], ["ArtBot", "Models", "Advanced", "Beta", "EdgeTrace", "DepthMap"])
|
864 |
# tabbed_interface = gr.TabbedInterface([new_welcome, advanced_tab, beta], ["Artbots", "Advanced", "Beta"])
|
865 |
tabbed_interface.launch()
|