arxivgpt kim commited on
Commit
2f1fdee
·
verified ·
1 Parent(s): 4f0a331

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -9
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, # 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):
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)