DigiP-AI commited on
Commit
19d18f4
·
verified ·
1 Parent(s): e9f29d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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", num_images_per_prompt =1, 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
-
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)
@@ -86,6 +86,7 @@ def query(lora_id, prompt, is_negative=False, steps=28, cfg_scale=3.5, sampler=
86
  "cfg_scale": cfg_scale,
87
  "seed": seed if seed != -1 else random.randint(1, 1000000000),
88
  "strength": strength,
 
89
  "parameters": {
90
  "width": width, # Pass the width to the API
91
  "height": height # Pass the height to the API
 
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
 
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)
 
86
  "cfg_scale": cfg_scale,
87
  "seed": seed if seed != -1 else random.randint(1, 1000000000),
88
  "strength": strength,
89
+ "num_images_per_prompt": NUM_IMAGES_PER_PROMPT,
90
  "parameters": {
91
  "width": width, # Pass the width to the API
92
  "height": height # Pass the height to the API