소스 검색

get seed from image name

jtydhr88 1 년 전
부모
커밋
6e9fcfb411
1개의 변경된 파일7개의 추가작업 그리고 2개의 파일을 삭제
  1. 7 2
      scripts/api.py

+ 7 - 2
scripts/api.py

@@ -64,12 +64,17 @@ def StableStudio_api(_: gr.Blocks, app: FastAPI):
 
                 encoded_content = api.encode_pil_to_base64(img)
 
+                image_name = os.path.basename(file)
+
+                seed = int(image_name.split(".")[0].split("-")[1])
+
                 return_value = {
-                    "image_name": os.path.basename(file),
+                    "image_name": image_name,
                     "create_date": os.path.getctime(file),
                     "content": encoded_content,
                     "width": width,
-                    "height": height
+                    "height": height,
+                    "seed": seed
                 }
 
                 return_values.append(return_value)