Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -43,6 +43,19 @@ def flip_text(prompt, negative_prompt, task, steps, sampler, cfg_scale, seed):
|
|
| 43 |
|
| 44 |
url_sd5 = os.getenv("url_sd5")
|
| 45 |
url_sd6 = os.getenv("url_sd6")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
try:
|
| 47 |
with closing(create_connection(f"{url_sd3}", timeout=60)) as conn:
|
| 48 |
conn.send('{"fn_index":3,"session_hash":""}')
|
|
@@ -185,7 +198,8 @@ with gr.Blocks(css=css) as demo:
|
|
| 185 |
with gr.Row():
|
| 186 |
task = gr.Radio(interactive=True, value="Stable Diffusion XL 1.0", show_label=True, label="Модель нейросети:", choices=['Stable Diffusion XL 1.0', 'Crystal Clear XL',
|
| 187 |
'Juggernaut XL', 'DreamShaper XL',
|
| 188 |
-
'SDXL Niji', 'Cinemax SDXL', 'NightVision XL'
|
|
|
|
| 189 |
with gr.Tab("Расширенные настройки"):
|
| 190 |
with gr.Row():
|
| 191 |
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")
|
|
|
|
| 43 |
|
| 44 |
url_sd5 = os.getenv("url_sd5")
|
| 45 |
url_sd6 = os.getenv("url_sd6")
|
| 46 |
+
|
| 47 |
+
if task == "Playground v2":
|
| 48 |
+
playground = srt(os.getenv("playground"))
|
| 49 |
+
client = Client(playground)
|
| 50 |
+
result = client.predict(prompt, "", False, 220, 1024, 1024, 3, True, api_name="/run")
|
| 51 |
+
return result[0][0]['image']
|
| 52 |
+
|
| 53 |
+
if task == "OpenDalle v1.1":
|
| 54 |
+
opendalle = str(os.getenv("opendalle"))
|
| 55 |
+
client = Client(opendalle)
|
| 56 |
+
result = client.predict(prompt, "", "", "", False, False, False, 999, 1024, 1024, 5, 5, 25, 25, False, api_name="/run")
|
| 57 |
+
return result
|
| 58 |
+
|
| 59 |
try:
|
| 60 |
with closing(create_connection(f"{url_sd3}", timeout=60)) as conn:
|
| 61 |
conn.send('{"fn_index":3,"session_hash":""}')
|
|
|
|
| 198 |
with gr.Row():
|
| 199 |
task = gr.Radio(interactive=True, value="Stable Diffusion XL 1.0", show_label=True, label="Модель нейросети:", choices=['Stable Diffusion XL 1.0', 'Crystal Clear XL',
|
| 200 |
'Juggernaut XL', 'DreamShaper XL',
|
| 201 |
+
'SDXL Niji', 'Cinemax SDXL', 'NightVision XL',
|
| 202 |
+
'Playground v2', 'OpenDalle v1.1'])
|
| 203 |
with gr.Tab("Расширенные настройки"):
|
| 204 |
with gr.Row():
|
| 205 |
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")
|