Rooni commited on
Commit
25070e1
1 Parent(s): d3bb725

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -11,11 +11,11 @@ API_URL = "https://api-inference.huggingface.co/models/openskyml/dalle-3-xl"
11
  API_TOKEN = os.getenv("HF_READ_TOKEN")
12
  headers = {"Authorization": f"Bearer {API_TOKEN}"}
13
  timeout = 100
14
- models_list = ["AbsoluteReality 1.8.1", "DALL-E 3 XL", "Playground 2", "Openjourney 4", "Lyriel 1.6", "Animagine XL 2.0", "Counterfeit 2.5", "Realistic Vision 5.1", "Incursios 1.6", "Anime Detailer XL", "Vector Art XL", "epiCRealism", "PixelArt XL", "NewReality XL", "Anything 5.0", "Disney", "CleanLinearMix"]
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,6 +64,8 @@ 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
 
68
  payload = {
69
  "inputs": prompt,
@@ -92,6 +94,9 @@ with gr.Blocks(css=css) as dalle:
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
  with gr.Tab("Расширенные настройки"):
 
11
  API_TOKEN = os.getenv("HF_READ_TOKEN")
12
  headers = {"Authorization": f"Bearer {API_TOKEN}"}
13
  timeout = 100
14
+ models_list = ["AbsoluteReality 1.8.1", "DALL-E 3 XL", "Playground 2", "Openjourney 4", "Lyriel 1.6", "Animagine XL 2.0", "Counterfeit 2.5", "Realistic Vision 5.1", "Incursios 1.6", "Anime Detailer XL", "Vector Art XL", "epiCRealism", "PixelArt XL", "NewReality XL", "Anything 5.0", "Disney", "CleanLinearMix", "Custom"]
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
 
 
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/{custom}"
69
 
70
  payload = {
71
  "inputs": prompt,
 
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
+ custom = gr.Textbox(show_label=False, placeholder="autor/model — openskyml/dalle-3-xl")
99
+
100
 
101
 
102
  with gr.Tab("Расширенные настройки"):