Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ models_list = ["AbsoluteReality 1.8.1", "DALL-E 3 XL", "Playground 2", "Openjour
|
|
15 |
|
16 |
# PLEASE ❤ like ❤ this space. Please like me. I am 12 years old, one of my projects is: https://ai-hub.rf.gd . I live in Russia, I don't know English very well. Therefore, I apologize that there is only Russian here, but I think it will not be difficult to translate all this. (For example, using gpt)
|
17 |
|
18 |
-
def query(prompt, model, is_negative=False, steps=30, cfg_scale=7, sampler="DPM++ 2M Karras", seed=-1
|
19 |
if prompt == "" or prompt == None:
|
20 |
return None
|
21 |
|
@@ -64,8 +64,6 @@ def query(prompt, model, is_negative=False, steps=30, cfg_scale=7, sampler="DPM+
|
|
64 |
API_URL = "https://api-inference.huggingface.co/models/goofyai/disney_style_xl"
|
65 |
if model == 'CleanLinearMix':
|
66 |
API_URL = "https://api-inference.huggingface.co/models/digiplay/CleanLinearMix_nsfw"
|
67 |
-
if model == 'Custom':
|
68 |
-
API_URL == f'https://api-inference.huggingface.co/models/{customa}/{customm}'
|
69 |
|
70 |
payload = {
|
71 |
"inputs": prompt,
|
@@ -94,11 +92,7 @@ with gr.Blocks(css=css) as dalle:
|
|
94 |
text_prompt = gr.Textbox(label="Prompt", placeholder="Описание изображения", lines=3, elem_id="prompt-text-input")
|
95 |
with gr.Row():
|
96 |
model = gr.Radio(label="Модель", value="DALL-E 3 XL", choices=models_list)
|
97 |
-
|
98 |
-
with gr.Row():
|
99 |
-
customa = gr.Textbox(show_label=False, placeholder="autor — openskyml")
|
100 |
-
customm = gr.Textbox(show_label=False, placeholder="model — dalle-3-xl")
|
101 |
-
|
102 |
|
103 |
|
104 |
with gr.Tab("Расширенные настройки"):
|
@@ -119,6 +113,6 @@ with gr.Blocks(css=css) as dalle:
|
|
119 |
with gr.Row():
|
120 |
image_output = gr.Image(type="pil", label="Изображение", elem_id="gallery")
|
121 |
|
122 |
-
text_button.click(query, inputs=[text_prompt, model, negative_prompt, steps, cfg, method, seed
|
123 |
|
124 |
dalle.launch(show_api=False, share=False)
|
|
|
15 |
|
16 |
# PLEASE ❤ like ❤ this space. Please like me. I am 12 years old, one of my projects is: https://ai-hub.rf.gd . I live in Russia, I don't know English very well. Therefore, I apologize that there is only Russian here, but I think it will not be difficult to translate all this. (For example, using gpt)
|
17 |
|
18 |
+
def query(prompt, model, is_negative=False, steps=30, cfg_scale=7, sampler="DPM++ 2M Karras", seed=-1):
|
19 |
if prompt == "" or prompt == None:
|
20 |
return None
|
21 |
|
|
|
64 |
API_URL = "https://api-inference.huggingface.co/models/goofyai/disney_style_xl"
|
65 |
if model == 'CleanLinearMix':
|
66 |
API_URL = "https://api-inference.huggingface.co/models/digiplay/CleanLinearMix_nsfw"
|
|
|
|
|
67 |
|
68 |
payload = {
|
69 |
"inputs": prompt,
|
|
|
92 |
text_prompt = gr.Textbox(label="Prompt", placeholder="Описание изображения", lines=3, elem_id="prompt-text-input")
|
93 |
with gr.Row():
|
94 |
model = gr.Radio(label="Модель", value="DALL-E 3 XL", choices=models_list)
|
95 |
+
|
|
|
|
|
|
|
|
|
96 |
|
97 |
|
98 |
with gr.Tab("Расширенные настройки"):
|
|
|
113 |
with gr.Row():
|
114 |
image_output = gr.Image(type="pil", label="Изображение", elem_id="gallery")
|
115 |
|
116 |
+
text_button.click(query, inputs=[text_prompt, model, negative_prompt, steps, cfg, method, seed], outputs=image_output)
|
117 |
|
118 |
dalle.launch(show_api=False, share=False)
|