Skip to content

Commit 23a6a28

Browse files
Merge pull request #83 from cumulo-autumn/dev/ddpn08
Update the demo frontend framework
2 parents 741b0fc + d9af40e commit 23a6a28

36 files changed

+1832
-29491
lines changed

demo/realtime-txt2img/.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Dockerfile
2+
.dockerignore
3+
frontend/node_modules

demo/realtime-txt2img/Dockerfile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ FROM node:20-alpine AS frontend
33
RUN apk add --no-cache libc6-compat
44
WORKDIR /app
55

6-
COPY view .
7-
RUN npm ci
8-
RUN npm run build
6+
COPY frontend .
7+
RUN npm i -g pnpm
8+
RUN pnpm i
9+
RUN pnpm run build
910

10-
# build backend on CUDA
11+
# build backend on CUDA
1112
FROM nvidia/cuda:12.2.2-cudnn8-devel-ubuntu22.04 AS backend
1213
WORKDIR /app
1314

@@ -56,14 +57,13 @@ RUN pyenv install $PYTHON_VERSION && \
5657

5758
COPY --chown=user:user . .
5859
# change dir since pip needs to seed whl folder
59-
RUN cd server && pip install --no-cache-dir --upgrade -r requirements.txt
60-
RUN --mount=type=secret,id=GITHUB_TOKEN,mode=0444,required=true \
61-
pip install git+https://$(cat /run/secrets/GITHUB_TOKEN)@github.com/cumulo-autumn/StreamDiffusion.git@main#egg=streamdiffusion[tensorrt]
60+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
61+
RUN pip install git+https://github.com/cumulo-autumn/StreamDiffusion.git@main#egg=streamdiffusion[tensorrt]
6262
RUN python -m streamdiffusion.tools.install-tensorrt
6363

64-
COPY --from=frontend /app/build ./view/build
64+
COPY --from=frontend /app/dist ./frontend/dist
6565

66-
WORKDIR $HOME/app/server
66+
WORKDIR $HOME/app
6767

6868
USER user
6969
CMD ["python", "main.py"]

demo/realtime-txt2img/README-ja.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ StreamDiffusion を用いた GUI を提供します。
1515

1616
```bash
1717
pip install -r requirements.txt
18-
cd view
19-
npm i
20-
npm run build
21-
cd ../server
18+
cd frontend
19+
pnpm i
20+
pnpm run build
21+
cd ..
2222
python main.py
2323
```
2424

demo/realtime-txt2img/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ You can realtimely generate 4x4 images from text, on changing the input prompt.
1313

1414
```bash
1515
pip install -r requirements.txt
16-
cd view
17-
npm i
18-
npm run build
19-
cd ../server
16+
cd frontend
17+
pnpm i
18+
pnpm run build
19+
cd ..
2020
python main.py
2121
```
2222

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tsconfig.tsbuildinfo
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
singleQuote: true
2+
semi: false
3+
trailingComma: all
4+
printWidth: 150
File renamed without changes.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" href="/favicon.ico" />
6+
<meta name="viewport" content="minimum-scale=1, initial-scale=1, width=device-width, user-scalable=no" />
7+
8+
<link rel="preconnect" href="https://fonts.googleapis.com" />
9+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
10+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@500&family=Zen+Kaku+Gothic+New:wght@500&display=swap" rel="stylesheet" />
11+
12+
<title>Txt2Img demo</title>
13+
</head>
14+
<body>
15+
<div id="root"></div>
16+
<script type="module" src="/src/main.tsx"></script>
17+
</body>
18+
</html>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "view",
3+
"version": "0.1.0",
4+
"private": true,
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "tsc && vite build",
9+
"preview": "vite preview"
10+
},
11+
"dependencies": {
12+
"@mantine/core": "^7.3.1",
13+
"react": "^18.2.0",
14+
"react-dom": "^18.2.0"
15+
},
16+
"devDependencies": {
17+
"@types/react": "^18.2.38",
18+
"@types/react-dom": "^18.2.17",
19+
"@vitejs/plugin-react": "^4.2.1",
20+
"postcss": "^8.4.32",
21+
"postcss-preset-mantine": "^1.11.1",
22+
"postcss-simple-vars": "^7.0.1",
23+
"prettier": "^3.1.0",
24+
"typescript": "^4.9.5",
25+
"vite": "^5.0.7",
26+
"vite-tsconfig-paths": "^4.2.2"
27+
}
28+
}

0 commit comments

Comments
 (0)