Rooni commited on
Commit
ae56df6
1 Parent(s): 3e6f556

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -23,7 +23,14 @@ def query(prompt, model, is_negative=False, steps=30, cfg_scale=7, sampler="DPM+
23
  API_TOKEN = random.choice([os.getenv("HF_READ_TOKEN"), os.getenv("HF_READ_TOKEN_2"), os.getenv("HF_READ_TOKEN_3"), os.getenv("HF_READ_TOKEN_4"), os.getenv("HF_READ_TOKEN_5")]) # it is free
24
  headers = {"Authorization": f"Bearer {API_TOKEN}"}
25
  key = random.randint(0, 999)
 
 
 
 
 
 
26
 
 
27
  print(f'\033[1mГенерация {key}:\033[0m {prompt}')
28
  if model == 'DALL-E 3 XL':
29
  API_URL = "https://api-inference.huggingface.co/models/openskyml/dalle-3-xl"
@@ -57,19 +64,13 @@ def query(prompt, model, is_negative=False, steps=30, cfg_scale=7, sampler="DPM+
57
  API_URL = "https://api-inference.huggingface.co/models/DoctorDiffusion/doctor-diffusion-s-controllable-vector-art-xl-lora"
58
  if model == 'Disney':
59
  API_URL = "https://api-inference.huggingface.co/models/goofyai/disney_style_xl"
60
- prompt = f"Стиль Disney. {prompt}"
61
  if model == 'CleanLinearMix':
62
  API_URL = "https://api-inference.huggingface.co/models/digiplay/CleanLinearMix_nsfw"
63
  if model == 'OrangeMixs':
64
  API_URL = "https://api-inference.huggingface.co/models/WarriorMama777/OrangeMixs"
65
 
66
- prompt = f"{prompt} | ультра детализация, ультра проработка, ультра качество, идеально."
67
 
68
- language = detect(prompt)
69
-
70
- if language == 'ru':
71
- prompt = GoogleTranslator(source='ru', target='en').translate(prompt)
72
- print(f'\033[1mГенерация {key} перевод:\033[0m {prompt}')
73
 
74
 
75
  payload = {
@@ -125,7 +126,7 @@ with gr.Blocks(css=css) as dalle:
125
 
126
  with gr.Tab("Информация"):
127
  with gr.Row():
128
- gr.Textbox(label="Шаблон prompt", value="{prompt} | ультра детализация, ультра проработка, ультра качество, идеально.")
129
 
130
  with gr.Row():
131
  text_button = gr.Button("Генерация", variant='primary', elem_id="gen-button")
 
23
  API_TOKEN = random.choice([os.getenv("HF_READ_TOKEN"), os.getenv("HF_READ_TOKEN_2"), os.getenv("HF_READ_TOKEN_3"), os.getenv("HF_READ_TOKEN_4"), os.getenv("HF_READ_TOKEN_5")]) # it is free
24
  headers = {"Authorization": f"Bearer {API_TOKEN}"}
25
  key = random.randint(0, 999)
26
+
27
+ language = detect(prompt)
28
+
29
+ if language == 'ru':
30
+ prompt = GoogleTranslator(source='ru', target='en').translate(prompt)
31
+ print(f'\033[1mГенерация {key} перевод:\033[0m {prompt}')
32
 
33
+ prompt = f"{prompt} | ultra detail, ultra elaboration, ultra quality, perfect."
34
  print(f'\033[1mГенерация {key}:\033[0m {prompt}')
35
  if model == 'DALL-E 3 XL':
36
  API_URL = "https://api-inference.huggingface.co/models/openskyml/dalle-3-xl"
 
64
  API_URL = "https://api-inference.huggingface.co/models/DoctorDiffusion/doctor-diffusion-s-controllable-vector-art-xl-lora"
65
  if model == 'Disney':
66
  API_URL = "https://api-inference.huggingface.co/models/goofyai/disney_style_xl"
67
+ prompt = f"Disney style. {prompt}"
68
  if model == 'CleanLinearMix':
69
  API_URL = "https://api-inference.huggingface.co/models/digiplay/CleanLinearMix_nsfw"
70
  if model == 'OrangeMixs':
71
  API_URL = "https://api-inference.huggingface.co/models/WarriorMama777/OrangeMixs"
72
 
 
73
 
 
 
 
 
 
74
 
75
 
76
  payload = {
 
126
 
127
  with gr.Tab("Информация"):
128
  with gr.Row():
129
+ gr.Textbox(label="Шаблон prompt", value="{prompt} | ultra detail, ultra elaboration, ultra quality, perfect.")
130
 
131
  with gr.Row():
132
  text_button = gr.Button("Генерация", variant='primary', elem_id="gen-button")