Spaces:
Running
Running
arxivgpt kim
commited on
Update app.py
Browse files
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 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
|
|
23 |
)
|
24 |
-
print(
|
25 |
-
return
|
|
|
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)
|