Spaces:
Paused
Paused
arxivgpt kim commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,19 +12,20 @@ def get_caption(image_in):
|
|
| 12 |
return results[:4] # Return first 4 images in case the API returns more
|
| 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 |
-
|
| 24 |
api_name="/predict"
|
| 25 |
)
|
|
|
|
| 26 |
print(results)
|
| 27 |
-
return results
|
| 28 |
|
| 29 |
|
| 30 |
def infer(image_in):
|
|
|
|
| 12 |
return results[:4] # Return first 4 images in case the API returns more
|
| 13 |
|
| 14 |
def get_lcm(prompt):
|
| 15 |
+
# Make sure the indentation within this function is consistent
|
| 16 |
client = Client("https://latent-consistency-lcm-lora-for-sdxl.hf.space/")
|
|
|
|
| 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 |
+
# More parameters can be added here if needed
|
| 24 |
api_name="/predict"
|
| 25 |
)
|
| 26 |
+
# Process results and possibly call predict multiple times if multiple images are needed
|
| 27 |
print(results)
|
| 28 |
+
return results # Placeholder for actual return value, consider gathering multiple predictions here
|
| 29 |
|
| 30 |
|
| 31 |
def infer(image_in):
|