Update app.py
Browse files
app.py
CHANGED
|
@@ -10,6 +10,7 @@ from PIL import Image
|
|
| 10 |
import shutil
|
| 11 |
import httpx
|
| 12 |
import time
|
|
|
|
| 13 |
|
| 14 |
# 로깅 설정
|
| 15 |
logging.basicConfig(level=logging.INFO)
|
|
@@ -85,13 +86,13 @@ def respond(image, prompt, steps, cfg_scale, eta, fs, seed, video_length):
|
|
| 85 |
# 이미지 파일 처리
|
| 86 |
if image is not None:
|
| 87 |
with open(image, "rb") as f:
|
| 88 |
-
image_data = f.read()
|
| 89 |
else:
|
| 90 |
image_data = None
|
| 91 |
|
| 92 |
# 비디오 생성 요청
|
| 93 |
result = api_client.predict(
|
| 94 |
-
image_data, #
|
| 95 |
prompt,
|
| 96 |
steps,
|
| 97 |
cfg_scale,
|
|
|
|
| 10 |
import shutil
|
| 11 |
import httpx
|
| 12 |
import time
|
| 13 |
+
import base64
|
| 14 |
|
| 15 |
# 로깅 설정
|
| 16 |
logging.basicConfig(level=logging.INFO)
|
|
|
|
| 86 |
# 이미지 파일 처리
|
| 87 |
if image is not None:
|
| 88 |
with open(image, "rb") as f:
|
| 89 |
+
image_data = base64.b64encode(f.read()).decode('utf-8')
|
| 90 |
else:
|
| 91 |
image_data = None
|
| 92 |
|
| 93 |
# 비디오 생성 요청
|
| 94 |
result = api_client.predict(
|
| 95 |
+
image_data, # base64로 인코딩된 이미지 데이터
|
| 96 |
prompt,
|
| 97 |
steps,
|
| 98 |
cfg_scale,
|