bealimehdi commited on
Commit
87b2b2b
·
verified ·
1 Parent(s): e23cf9a

Upload 9 files

Browse files
.gitattributes CHANGED
@@ -90,3 +90,6 @@ backend/venv/Scripts/pythonw.exe filter=lfs diff=lfs merge=lfs -text
90
  backend/venv/Scripts/tiny-agents.exe filter=lfs diff=lfs merge=lfs -text
91
  backend/venv/Scripts/tqdm.exe filter=lfs diff=lfs merge=lfs -text
92
  backend/venv/Scripts/uvicorn.exe filter=lfs diff=lfs merge=lfs -text
 
 
 
 
90
  backend/venv/Scripts/tiny-agents.exe filter=lfs diff=lfs merge=lfs -text
91
  backend/venv/Scripts/tqdm.exe filter=lfs diff=lfs merge=lfs -text
92
  backend/venv/Scripts/uvicorn.exe filter=lfs diff=lfs merge=lfs -text
93
+ temp_e953a65b-7f44-47f5-a48c-3f1b1d6eedff_template_piclumen-1744033346326.png filter=lfs diff=lfs merge=lfs -text
94
+ temp_f7783cf8-526f-4686-b544-626bf9a3f508_template_piclumen-1744033346326.png filter=lfs diff=lfs merge=lfs -text
95
+ template.jpg filter=lfs diff=lfs merge=lfs -text
Dockerfile ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9
2
+
3
+ WORKDIR /code
4
+
5
+ # Copy requirements first for caching
6
+ COPY ./requirements.txt /code/requirements.txt
7
+
8
+ # Install dependencies
9
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
10
+
11
+ # Copy the rest of the application
12
+ COPY . /code
13
+
14
+ # Create static directory for generated images
15
+ RUN mkdir -p /code/static
16
+ RUN chmod 777 /code/static
17
+
18
+ # Start the application
19
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
get_id.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import replicate
2
+ import os
3
+ from dotenv import load_dotenv
4
+
5
+ load_dotenv()
6
+
7
+ candidates = [
8
+ "wangfuyun/instantid",
9
+ "instantx/instantid",
10
+ "zsxkib/instant-id",
11
+ "lucataco/instantid",
12
+ "camenduru/instantid"
13
+ ]
14
+
15
+ for name in candidates:
16
+ try:
17
+ model = replicate.models.get(name)
18
+ versions = model.versions.list()
19
+ if versions:
20
+ print(f"FOUND: {name} -> {versions[0].id}")
21
+ break
22
+ except Exception as e:
23
+ print(f"FAILED: {name} ({e})")
main.py ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from dotenv import load_dotenv
2
+ load_dotenv()
3
+
4
+ from fastapi import FastAPI
5
+ from fastapi.middleware.cors import CORSMiddleware
6
+ from pydantic import BaseModel
7
+ from routers import generate
8
+
9
+ from fastapi.staticfiles import StaticFiles
10
+ import os
11
+
12
+ app = FastAPI(title="Pickabook API", version="0.1.0")
13
+
14
+ # Create static directory if it doesn't exist
15
+ os.makedirs("static", exist_ok=True)
16
+ app.mount("/static", StaticFiles(directory="static"), name="static")
17
+
18
+ # CORS setup for local development
19
+ app.add_middleware(
20
+ CORSMiddleware,
21
+ allow_origins=["http://localhost:3000", "http://localhost:3001", "http://localhost:3002"], # React dev servers
22
+ allow_credentials=True,
23
+ allow_methods=["*"],
24
+ allow_headers=["*"],
25
+ )
26
+
27
+ app.include_router(generate.router, prefix="/api", tags=["generation"])
28
+
29
+ class HealthCheck(BaseModel):
30
+ status: str = "ok"
31
+
32
+ @app.get("/", response_model=HealthCheck)
33
+ async def health_check():
34
+ return {"status": "ok"}
35
+
36
+ if __name__ == "__main__":
37
+ import uvicorn
38
+ uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True)
requirements.txt ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ fastapi
2
+ uvicorn
3
+ python-multipart
4
+ httpx
5
+ python-dotenv
6
+ pydantic
7
+ gradio_client
8
+ replicate
temp_e953a65b-7f44-47f5-a48c-3f1b1d6eedff_girl-happy-fashion-studio-portrait-confidence-style-mock-up-space-white-background-child-smile-excited-model-pride-422740537.webp ADDED
temp_e953a65b-7f44-47f5-a48c-3f1b1d6eedff_template_piclumen-1744033346326.png ADDED

Git LFS Details

  • SHA256: 3ef09feb6c54df59b142250f4349f2cfa7a0152b589c583742f287842b67af66
  • Pointer size: 131 Bytes
  • Size of remote file: 849 kB
temp_f7783cf8-526f-4686-b544-626bf9a3f508_girl-happy-fashion-studio-portrait-confidence-style-mock-up-space-white-background-child-smile-excited-model-pride-422740537.webp ADDED
temp_f7783cf8-526f-4686-b544-626bf9a3f508_template_piclumen-1744033346326.png ADDED

Git LFS Details

  • SHA256: 3ef09feb6c54df59b142250f4349f2cfa7a0152b589c583742f287842b67af66
  • Pointer size: 131 Bytes
  • Size of remote file: 849 kB
template.jpg ADDED

Git LFS Details

  • SHA256: fdc79f8faac7572f6d3f5d66c7940bdddd452983cc70c077e8e63f3fd2354707
  • Pointer size: 131 Bytes
  • Size of remote file: 264 kB