Update app.py
Browse files
app.py
CHANGED
@@ -202,22 +202,15 @@ def img2img(input_image, denoising, prompt, negative_prompt, model, steps, sampl
|
|
202 |
return job["imageUrl"]
|
203 |
|
204 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
205 |
|
206 |
with gr.Blocks(css=css) as demo:
|
207 |
-
# Вставка JavaScript для динамической загрузки CSS
|
208 |
-
gr.HTML(
|
209 |
-
"""
|
210 |
-
<script>
|
211 |
-
var head = document.getElementsByTagName('head')[0];
|
212 |
-
var link = document.createElement('link');
|
213 |
-
link.rel = 'stylesheet';
|
214 |
-
link.type = 'text/css';
|
215 |
-
link.href = 'https://aihubyufi-aihub.static.hf.space/style.css'; // URL вашего CSS
|
216 |
-
head.appendChild(link);
|
217 |
-
</script>
|
218 |
-
"""
|
219 |
-
)
|
220 |
-
|
221 |
with gr.Row():
|
222 |
with gr.Accordion(label="Модель", open=False):
|
223 |
model = gr.Radio(interactive=True, value="absolutereality_v181.safetensors [3d9d4d2b]", show_label=False, choices=prodia_client.list_models())
|
@@ -290,4 +283,4 @@ with gr.Blocks(css=css) as demo:
|
|
290 |
i2i_image_output = gr.Image()
|
291 |
|
292 |
i2i_text_button.click(img2img, inputs=[i2i_image_input, i2i_denoising, i2i_prompt, i2i_negative_prompt, model, i2i_steps, i2i_sampler, i2i_cfg_scale, i2i_width, i2i_height, i2i_seed], outputs=i2i_image_output)
|
293 |
-
demo.queue(concurrency_count=
|
|
|
202 |
return job["imageUrl"]
|
203 |
|
204 |
|
205 |
+
# Ссылка на файл CSS
|
206 |
+
css_url = "https://aihubyufi-aihub.static.hf.space/style.css"
|
207 |
+
|
208 |
+
# Получение CSS по ссылке
|
209 |
+
response = requests.get(css_url)
|
210 |
+
css = response.text
|
211 |
+
|
212 |
|
213 |
with gr.Blocks(css=css) as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
214 |
with gr.Row():
|
215 |
with gr.Accordion(label="Модель", open=False):
|
216 |
model = gr.Radio(interactive=True, value="absolutereality_v181.safetensors [3d9d4d2b]", show_label=False, choices=prodia_client.list_models())
|
|
|
283 |
i2i_image_output = gr.Image()
|
284 |
|
285 |
i2i_text_button.click(img2img, inputs=[i2i_image_input, i2i_denoising, i2i_prompt, i2i_negative_prompt, model, i2i_steps, i2i_sampler, i2i_cfg_scale, i2i_width, i2i_height, i2i_seed], outputs=i2i_image_output)
|
286 |
+
demo.queue(concurrency_count=512, max_size=512, api_open=False).launch(max_threads=256)
|