Spaces:
Running
Running
arxivgpt kim
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -12,21 +12,22 @@ 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 |
-
# 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, #
|
19 |
-
0.3, #
|
20 |
-
8, #
|
21 |
-
0, #
|
22 |
-
True, #
|
23 |
-
#
|
24 |
api_name="/predict"
|
25 |
)
|
26 |
-
#
|
27 |
print(results)
|
28 |
-
return results #
|
29 |
|
|
|
30 |
|
31 |
def infer(image_in):
|
32 |
caption = 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 |
+
# 'client.predict' 호출에서 들여쓰기가 올바른지 확인해야 합니다.
|
17 |
results = client.predict(
|
18 |
+
prompt, # 'parameter_5' 텍스트박스 컴포넌트의 문자열
|
19 |
+
0.3, # 'Guidance' 슬라이더 컴포넌트의 0.0과 5 사이의 부동소수점 값
|
20 |
+
8, # 'Steps' 슬라이더 컴포넌트의 2와 10 사이의 부동소수점 값
|
21 |
+
0, # 'Seed' 슬라이더 컴포넌트의 0과 12013012031030 사이의 부동소수점 값
|
22 |
+
True, # 'Randomize' 체크박스 컴포넌트의 불리언 값
|
23 |
+
# 필요한 경우 여기에 더 많은 파라미터를 추가할 수 있습니다.
|
24 |
api_name="/predict"
|
25 |
)
|
26 |
+
# 결과 처리 및 여러 이미지가 필요한 경우 여러 번 'predict'를 호출할 수 있습니다.
|
27 |
print(results)
|
28 |
+
return results # 실제 반환값을 위한 플레이스홀더, 여러 예측을 모으는 것을 고려해 보세요.
|
29 |
|
30 |
+
# 코드의 나머지 부분이 일관된 들여쓰기를 유지하면서 작성됩니다.
|
31 |
|
32 |
def infer(image_in):
|
33 |
caption = get_caption(image_in)
|