Rooni commited on
Commit
97fdc06
1 Parent(s): 1470e94

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
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, custom=None):
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/{custom}'
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
- with gr.Column():
97
- model = gr.Radio(label="Модель", value="DALL-E 3 XL", choices=models_list)
98
- with gr.Accordion(label="Custom", open=False):
99
- custom = gr.Textbox(show_label=False, placeholder="autor/model — openskyml/dalle-3-xl")
 
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, custom], outputs=image_output)
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)