Spaces:
Runtime error
Runtime error
Commit
•
5cebd6b
0
Parent(s):
Duplicate from mindtube/protogen-models
Browse filesCo-authored-by: Tony G <[email protected]>
- .gitattributes +34 -0
- README.md +13 -0
- app.py +96 -0
.gitattributes
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
title: Maximum Multiplier
|
3 |
+
emoji: 🛕🛕
|
4 |
+
colorFrom: green
|
5 |
+
colorTo: blue
|
6 |
+
sdk: gradio
|
7 |
+
sdk_version: 3.15.0
|
8 |
+
app_file: app.py
|
9 |
+
pinned: true
|
10 |
+
duplicated_from: mindtube/protogen-models
|
11 |
+
---
|
12 |
+
|
13 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
ADDED
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import os
|
3 |
+
import sys
|
4 |
+
from pathlib import Path
|
5 |
+
|
6 |
+
models = [
|
7 |
+
{"name": "Protogen 2.2", "url": "darkstorm2150/Protogen_v2.2_Official_Release"},
|
8 |
+
{"name": "Protogen X 3.4", "url": "darkstorm2150/Protogen_x3.4_Official_Release"},
|
9 |
+
{"name": "Protogen X 5.8", "url": "darkstorm2150/Protogen_x5.8_Official_Release"},
|
10 |
+
{"name": "Protogen X 5.3", "url": "darkstorm2150/Protogen_x5.3_Official_Release"},
|
11 |
+
{"name": "Protogen Nova", "url": "darkstorm2150/Protogen_Nova_Official_Release"},
|
12 |
+
{"name": "Protogen Ecplise", "url": "darkstorm2150/Protogen_Eclipse_Official_Release"},
|
13 |
+
{"name": "Protogen Infinity", "url": "darkstorm2150/Protogen_Infinity_Official_Release"},
|
14 |
+
]
|
15 |
+
|
16 |
+
current_model = models[0]
|
17 |
+
|
18 |
+
text_gen = gr.Interface.load("spaces/daspartho/prompt-extend")
|
19 |
+
|
20 |
+
models2 = []
|
21 |
+
for model in models:
|
22 |
+
model_url = f"models/{model['url']}"
|
23 |
+
loaded_model = gr.Interface.load(model_url, live=True, preprocess=True)
|
24 |
+
models2.append(loaded_model)
|
25 |
+
|
26 |
+
|
27 |
+
def text_it(inputs, text_gen=text_gen):
|
28 |
+
return text_gen(inputs)
|
29 |
+
|
30 |
+
|
31 |
+
def set_model(current_model_index):
|
32 |
+
global current_model
|
33 |
+
current_model = models[current_model_index]
|
34 |
+
return gr.update(value=f"{current_model['name']}")
|
35 |
+
|
36 |
+
|
37 |
+
def send_it(inputs, model_choice):
|
38 |
+
proc = models2[model_choice]
|
39 |
+
return proc(inputs)
|
40 |
+
|
41 |
+
|
42 |
+
with gr.Blocks() as myface:
|
43 |
+
gr.HTML(
|
44 |
+
|
45 |
+
)
|
46 |
+
|
47 |
+
with gr.Row():
|
48 |
+
with gr.Row():
|
49 |
+
input_text = gr.Textbox(label="Prompt idea", placeholder="Eg. Mystical zen garden", lines=1)
|
50 |
+
# Model selection dropdown
|
51 |
+
model_name1 = gr.Dropdown(
|
52 |
+
label="Choose Model",
|
53 |
+
choices=[m["name"] for m in models],
|
54 |
+
type="index",
|
55 |
+
value=current_model["name"],
|
56 |
+
interactive=True,
|
57 |
+
)
|
58 |
+
with gr.Row():
|
59 |
+
see_prompts = gr.Button("Generate Prompts")
|
60 |
+
run = gr.Button("Generate Images", variant="primary")
|
61 |
+
|
62 |
+
with gr.Row():
|
63 |
+
output1 = gr.Image(label="")
|
64 |
+
output2 = gr.Image(label="")
|
65 |
+
output3 = gr.Image(label="")
|
66 |
+
with gr.Row():
|
67 |
+
magic1 = gr.Textbox(label="Generated Prompt", lines=2)
|
68 |
+
magic2 = gr.Textbox(label="Generated Prompt", lines=2)
|
69 |
+
magic3 = gr.Textbox(label="Generated Prompt", lines=2)
|
70 |
+
with gr.Row():
|
71 |
+
output4 = gr.Image(label="")
|
72 |
+
output5 = gr.Image(label="")
|
73 |
+
output6 = gr.Image(label="")
|
74 |
+
with gr.Row():
|
75 |
+
magic4 = gr.Textbox(label="Generated Prompt", lines=2)
|
76 |
+
magic5 = gr.Textbox(label="Generated Prompt", lines=2)
|
77 |
+
magic6 = gr.Textbox(label="Generated Prompt", lines=2)
|
78 |
+
|
79 |
+
model_name1.change(set_model, inputs=model_name1, outputs=[output1, output2, output3, output4, output5, output6])
|
80 |
+
|
81 |
+
run.click(send_it, inputs=[magic1, model_name1], outputs=[output1])
|
82 |
+
run.click(send_it, inputs=[magic2, model_name1], outputs=[output2])
|
83 |
+
run.click(send_it, inputs=[magic3, model_name1], outputs=[output3])
|
84 |
+
run.click(send_it, inputs=[magic4, model_name1], outputs=[output4])
|
85 |
+
run.click(send_it, inputs=[magic5, model_name1], outputs=[output5])
|
86 |
+
run.click(send_it, inputs=[magic6, model_name1], outputs=[output6])
|
87 |
+
|
88 |
+
see_prompts.click(text_it, inputs=[input_text], outputs=[magic1])
|
89 |
+
see_prompts.click(text_it, inputs=[input_text], outputs=[magic2])
|
90 |
+
see_prompts.click(text_it, inputs=[input_text], outputs=[magic3])
|
91 |
+
see_prompts.click(text_it, inputs=[input_text], outputs=[magic4])
|
92 |
+
see_prompts.click(text_it, inputs=[input_text], outputs=[magic5])
|
93 |
+
see_prompts.click(text_it, inputs=[input_text], outputs=[magic6])
|
94 |
+
|
95 |
+
myface.queue(concurrency_count=200)
|
96 |
+
myface.launch(inline=True, show_api=False, max_threads=400)
|