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 |
|
|
@@ -65,7 +65,7 @@ def query(prompt, model, is_negative=False, steps=30, cfg_scale=7, sampler="DPM+
|
|
| 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/{
|
| 69 |
|
| 70 |
payload = {
|
| 71 |
"inputs": prompt,
|
|
@@ -93,10 +93,11 @@ with gr.Blocks(css=css) as dalle:
|
|
| 93 |
with gr.Row():
|
| 94 |
text_prompt = gr.Textbox(label="Prompt", placeholder="Описание изображения", lines=3, elem_id="prompt-text-input")
|
| 95 |
with gr.Row():
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
|
|
|
| 100 |
|
| 101 |
|
| 102 |
|
|
@@ -118,6 +119,6 @@ with gr.Blocks(css=css) as dalle:
|
|
| 118 |
with gr.Row():
|
| 119 |
image_output = gr.Image(type="pil", label="Изображение", elem_id="gallery")
|
| 120 |
|
| 121 |
-
text_button.click(query, inputs=[text_prompt, model, negative_prompt, steps, cfg, method, seed,
|
| 122 |
|
| 123 |
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, customa=None, customm=None):
|
| 19 |
if prompt == "" or prompt == None:
|
| 20 |
return None
|
| 21 |
|
|
|
|
| 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,
|
|
|
|
| 93 |
with gr.Row():
|
| 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 |
+
with gr.Accordion(label="Custom", open=False):
|
| 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 |
|
|
|
|
| 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, customa, customm], outputs=image_output)
|
| 123 |
|
| 124 |
dalle.launch(show_api=False, share=False)
|