Spaces:
Running
Running
lalashechka
commited on
Commit
•
d45d93b
1
Parent(s):
a1c524c
Update app.py
Browse files
app.py
CHANGED
@@ -46,29 +46,29 @@ def flip_text(prompt, negative_prompt, task, steps, sampler, cfg_scale, seed):
|
|
46 |
hf_token = os.getenv("hf_token")
|
47 |
if task == "Playground v2":
|
48 |
playground = str(os.getenv("playground"))
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
'
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
'
|
64 |
-
'
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
|
73 |
try:
|
74 |
with closing(create_connection(f"{url_sd3}", timeout=60)) as conn:
|
@@ -216,7 +216,7 @@ with gr.Blocks(css=css) as demo:
|
|
216 |
task = gr.Radio(interactive=True, value="Stable Diffusion XL 1.0", show_label=True, label="Модель нейросети:", choices=['Stable Diffusion XL 1.0', 'Crystal Clear XL',
|
217 |
'Juggernaut XL', 'DreamShaper XL',
|
218 |
'SDXL Niji', 'Cinemax SDXL', 'NightVision XL',
|
219 |
-
'Playground v2', '
|
220 |
with gr.Tab("Расширенные настройки"):
|
221 |
with gr.Row():
|
222 |
negative_prompt = gr.Textbox(placeholder="Negative Prompt", show_label=True, label='Negative Prompt:', lines=3, value="[deformed | disfigured], poorly drawn, [bad : wrong] anatomy, [extra | missing | floating | disconnected] limb, (mutated hands and fingers), blurry")
|
@@ -252,5 +252,5 @@ with gr.Blocks(css=css) as demo:
|
|
252 |
image_i2i = gr.Image(show_label=True, label='Увеличенное изображение:')
|
253 |
img2img_b.click(mirror, inputs=[image_output, scale_by, method, gfpgan, codeformer], outputs=image_i2i)
|
254 |
|
255 |
-
demo.queue(concurrency_count=
|
256 |
demo.launch()
|
|
|
46 |
hf_token = os.getenv("hf_token")
|
47 |
if task == "Playground v2":
|
48 |
playground = str(os.getenv("playground"))
|
49 |
+
with closing(create_connection(playground)) as conn:
|
50 |
+
conn.send('{"fn_index":0,"session_hash":""}')
|
51 |
+
conn.send(f'{{"fn_index":0,"data":["{prompt}"],"session_hash":""}}')
|
52 |
+
conn.recv()
|
53 |
+
conn.recv()
|
54 |
+
conn.recv()
|
55 |
+
conn.recv()
|
56 |
+
a = conn.recv()
|
57 |
+
photo = json.loads(a)['output']['data'][0]
|
58 |
+
return photo
|
59 |
+
|
60 |
+
if task == "Artigen v3":
|
61 |
+
artigen = str(os.getenv("artigen"))
|
62 |
+
with closing(create_connection(artigen)) as conn:
|
63 |
+
conn.send('{"fn_index":0,"session_hash":""}')
|
64 |
+
conn.send(f'{{"fn_index":0,"data":["{prompt}", 0, "No style"],"session_hash":""}}')
|
65 |
+
conn.recv()
|
66 |
+
conn.recv()
|
67 |
+
conn.recv()
|
68 |
+
conn.recv()
|
69 |
+
a = conn.recv()
|
70 |
+
photo = json.loads(a)['output']['data'][0]
|
71 |
+
return photo
|
72 |
|
73 |
try:
|
74 |
with closing(create_connection(f"{url_sd3}", timeout=60)) as conn:
|
|
|
216 |
task = gr.Radio(interactive=True, value="Stable Diffusion XL 1.0", show_label=True, label="Модель нейросети:", choices=['Stable Diffusion XL 1.0', 'Crystal Clear XL',
|
217 |
'Juggernaut XL', 'DreamShaper XL',
|
218 |
'SDXL Niji', 'Cinemax SDXL', 'NightVision XL',
|
219 |
+
'Playground v2', 'Artigen v3'])
|
220 |
with gr.Tab("Расширенные настройки"):
|
221 |
with gr.Row():
|
222 |
negative_prompt = gr.Textbox(placeholder="Negative Prompt", show_label=True, label='Negative Prompt:', lines=3, value="[deformed | disfigured], poorly drawn, [bad : wrong] anatomy, [extra | missing | floating | disconnected] limb, (mutated hands and fingers), blurry")
|
|
|
252 |
image_i2i = gr.Image(show_label=True, label='Увеличенное изображение:')
|
253 |
img2img_b.click(mirror, inputs=[image_output, scale_by, method, gfpgan, codeformer], outputs=image_i2i)
|
254 |
|
255 |
+
demo.queue(concurrency_count=24)
|
256 |
demo.launch()
|