arxivgpt kim commited on
Commit
846fc12
·
verified ·
1 Parent(s): 77a81d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -14
app.py CHANGED
@@ -12,22 +12,16 @@ def get_caption(image_in):
12
  return caption # caption 변수는 이미지 설명 문자열을 담고 있습니다.
13
 
14
 
15
- def get_lcm(prompt):
16
- client = Client("https://latent-consistency-lcm-lora-for-sdxl.hf.space/")
17
-
18
- # Consistent indentation for 'client.predict' call
19
  results = client.predict(
20
- prompt, # 'parameter_5' 텍스트박스 컴포넌트의 문자열
21
- 0.3, # 'Guidance' 슬라이더 컴포넌트의 0.0과 5 사이의 부동소수점
22
- 8, # 'Steps' 슬라이더 컴포넌트의 2와 10 사이의 부동소수점 값
23
- 0, # 'Seed' 슬라이더 컴포넌트의 0과 12013012031030 사이의 부동소수점 값
24
- True, # 'Randomize' 체크박스 컴포넌트의 불리언 값
25
- api_name="/predict"
26
  )
27
-
28
- # Process results and possibly call predict multiple times if multiple images are needed
29
- print(results)
30
- return results # 실제 API 응답에 기반한 반환 구문
31
 
32
  def infer(image_in):
33
  caption = get_caption(image_in)
 
12
  return caption # caption 변수는 이미지 설명 문자열을 담고 있습니다.
13
 
14
 
15
+ def get_lcm(caption):
16
+ client = Client("현재 사용할 이미지 생성 API URL")
17
+ # 적절한 이미지 생성 API 파라미터를 전달하여 결과 이미지를 요청합니다.
 
18
  results = client.predict(
19
+ prompt=caption, # 이미지 설명을 생성 API에 전달합니다.
20
+ number_of_images=1, # 생성하려는 이미지 개수입니다. 필요한 경우 값을 변경하세요.
21
+ api_name="/generate_image" # API 엔드포인트입니다. 해당 API에 맞게 수정하세요.
 
 
 
22
  )
23
+ # API에서 반환된 이미지들을 처리합니다. 반환 타입 및 방법에 대해서는 API 문서를 확인하세요.
24
+ return results # 부분은 생성된 이미지를 반환하는 것을 의미합니다.
 
 
25
 
26
  def infer(image_in):
27
  caption = get_caption(image_in)