arxivgpt kim commited on
Commit
4a6b70e
·
verified ·
1 Parent(s): 32ea1b8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -9
app.py CHANGED
@@ -13,16 +13,19 @@ def get_caption(image_in):
13
 
14
  def get_lcm(prompt):
15
  client = Client("https://latent-consistency-lcm-lora-for-sdxl.hf.space/")
16
- result = client.predict(
17
- prompt, # str in 'parameter_5' Textbox component
18
- 0.3, # float (numeric value between 0.0 and 5) in 'Guidance' Slider component
19
- 8, # float (numeric value between 2 and 10) in 'Steps' Slider component
20
- 0, # float (numeric value between 0 and 12013012031030) in 'Seed' Slider component
21
- True, # bool in 'Randomize' Checkbox component
22
- api_name="/predict"
 
 
23
  )
24
- print(result)
25
- return result[0]
 
26
 
27
  def infer(image_in):
28
  caption = get_caption(image_in)
 
13
 
14
  def get_lcm(prompt):
15
  client = Client("https://latent-consistency-lcm-lora-for-sdxl.hf.space/")
16
+ # Assuming 'client.predict' can return multiple image variations and accepts parameters to specify the number.
17
+ results = client.predict(
18
+ prompt, # str in 'parameter_5' Textbox component
19
+ 0.3, # float (numeric value between 0.0 and 5) in 'Guidance' Slider component
20
+ 8, # float (numeric value between 2 and 10) in 'Steps' Slider component
21
+ 0, # float (numeric value between 0 and 12013012031030) in 'Seed' Slider component
22
+ True, # bool in 'Randomize' Checkbox component
23
+ num_images=4, # New parameter to request 4 images (this parameter name might be different)
24
+ api_name="/predict"
25
  )
26
+ print(results)
27
+ return results[:4] # Return first 4 images in case the API returns more
28
+
29
 
30
  def infer(image_in):
31
  caption = get_caption(image_in)