DigiP-AI commited on
Commit
918c337
·
verified ·
1 Parent(s): a89df3f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -52,7 +52,7 @@ headers = {"Authorization": f"Bearer {API_TOKEN}"}
52
  timeout = 100
53
 
54
 
55
- def query(lora_id, prompt, is_negative=False, steps=28, cfg_scale=3.5, sampler="DPM++ 2M Karras", seed=-1, strength=0.7, width=1024, height=1024):
56
  if prompt == "" or prompt == None:
57
  return None
58
 
@@ -65,7 +65,7 @@ def query(lora_id, prompt, is_negative=False, steps=28, cfg_scale=3.5, sampler=
65
 
66
  API_TOKEN = random.choice([os.getenv("HF_READ_TOKEN")])
67
  headers = {"Authorization": f"Bearer {API_TOKEN}"}
68
- NUM_IMAGES_PER_PROMPT=1
69
  # prompt = GoogleTranslator(source='ru', target='en').translate(prompt)
70
  # print(f'\033[1mGeneration {key} translation:\033[0m {prompt}')
71
  prompt = GoogleTranslator(source='ru', target='en').translate(prompt)
@@ -190,7 +190,7 @@ with gr.Blocks(theme=theme, css=css, elem_id="app-container") as app:
190
  inputs = [text_prompt],
191
  )
192
 
193
- text_button.click(query, inputs=[custom_lora, text_prompt, negative_prompt, steps, cfg, num_images_per_prompt, method, seed, strength, width, height], outputs=[image_output, seed_output])
194
 
195
  with gr.Tab("Image Upscaler"):
196
  with gr.Row():
 
52
  timeout = 100
53
 
54
 
55
+ def query(lora_id, prompt, is_negative=False, steps=28, cfg_scale=3.5, sampler="DPM++ 2M Karras", seed=-1, num_images_per_prompt =1, strength=0.7, width=1024, height=1024):
56
  if prompt == "" or prompt == None:
57
  return None
58
 
 
65
 
66
  API_TOKEN = random.choice([os.getenv("HF_READ_TOKEN")])
67
  headers = {"Authorization": f"Bearer {API_TOKEN}"}
68
+ #NUM_IMAGES_PER_PROMPT=1
69
  # prompt = GoogleTranslator(source='ru', target='en').translate(prompt)
70
  # print(f'\033[1mGeneration {key} translation:\033[0m {prompt}')
71
  prompt = GoogleTranslator(source='ru', target='en').translate(prompt)
 
190
  inputs = [text_prompt],
191
  )
192
 
193
+ text_button.click(query, inputs=[custom_lora, text_prompt, negative_prompt, steps, cfg, num_images_per_prompt, method, seed, num_images_per_prompt, strength, width, height], outputs=[image_output, seed_output])
194
 
195
  with gr.Tab("Image Upscaler"):
196
  with gr.Row():