radames commited on
Commit
0e5136c
1 Parent(s): d1f4c77

docker layout

Browse files
Dockerfile CHANGED
@@ -3,6 +3,7 @@ FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04
3
  ARG DEBIAN_FRONTEND=noninteractive
4
 
5
  ENV PYTHONUNBUFFERED=1
 
6
 
7
  RUN apt-get update && apt-get install --no-install-recommends -y \
8
  build-essential \
@@ -12,11 +13,16 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
12
  git \
13
  ffmpeg \
14
  google-perftools \
 
15
  && apt-get clean && rm -rf /var/lib/apt/lists/*
16
 
17
-
18
  WORKDIR /code
19
 
 
 
 
 
 
20
  COPY ./requirements.txt /code/requirements.txt
21
 
22
  # Set up a new user named "user" with user ID 1000
@@ -39,6 +45,4 @@ WORKDIR $HOME/app
39
  COPY --chown=user . $HOME/app
40
 
41
  ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libtcmalloc.so.4
42
- # CMD ["uvicorn", "app-img2img:app", "--host", "0.0.0.0", "--port", "7860"]
43
- # CMD ["uvicorn", "app-txt2img:app", "--host", "0.0.0.0", "--port", "7860"]
44
- CMD ["uvicorn", "app-controlnet:app", "--host", "0.0.0.0", "--port", "7860"]
 
3
  ARG DEBIAN_FRONTEND=noninteractive
4
 
5
  ENV PYTHONUNBUFFERED=1
6
+ ENV NODE_MAJOR=20
7
 
8
  RUN apt-get update && apt-get install --no-install-recommends -y \
9
  build-essential \
 
13
  git \
14
  ffmpeg \
15
  google-perftools \
16
+ ca-certificates curl gnupg \
17
  && apt-get clean && rm -rf /var/lib/apt/lists/*
18
 
 
19
  WORKDIR /code
20
 
21
+ RUN mkdir -p /etc/apt/keyrings
22
+ RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
23
+ RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list > /dev/null
24
+ RUN apt-get update && apt-get install nodejs -y
25
+
26
  COPY ./requirements.txt /code/requirements.txt
27
 
28
  # Set up a new user named "user" with user ID 1000
 
45
  COPY --chown=user . $HOME/app
46
 
47
  ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libtcmalloc.so.4
48
+ CMD ["./build-run.sh"]
 
 
build-run.sh CHANGED
@@ -8,4 +8,9 @@ else
8
  echo -e "\033[1;31m\nfrontend build failed\n\033[0m" >&2 exit 1
9
  fi
10
  cd ../
11
- python run.py --reload --pipeline controlnet
 
 
 
 
 
 
8
  echo -e "\033[1;31m\nfrontend build failed\n\033[0m" >&2 exit 1
9
  fi
10
  cd ../
11
+ #check if var PIPELINE is set otherwise get default
12
+ if [ -z ${PIPELINE+x} ]; then
13
+ PIPELINE="controlnet"
14
+ fi
15
+ echo -e "\033[1;32m\npipeline: $PIPELINE \033[0m"
16
+ python3 run.py --port 7860 --host 0.0.0.0 --pipeline $PIPELINE
frontend/src/lib/components/VideoInput.svelte CHANGED
@@ -53,7 +53,7 @@
53
  }
54
  </script>
55
 
56
- <div class="relative overflow-hidden rounded-lg border border-slate-300">
57
  <div class="relative z-10 aspect-square w-full object-cover">
58
  <video
59
  class="aspect-square w-full object-cover"
 
53
  }
54
  </script>
55
 
56
+ <div class="relative mx-auto max-w-lg overflow-hidden rounded-lg border border-slate-300">
57
  <div class="relative z-10 aspect-square w-full object-cover">
58
  <video
59
  class="aspect-square w-full object-cover"
frontend/src/routes/+page.svelte CHANGED
@@ -110,14 +110,14 @@
110
  {#if pipelineParams}
111
  <article class="my-3 grid grid-cols-1 gap-3 sm:grid-cols-2">
112
  {#if isImageMode}
113
- <div class="col-start-1">
114
  <VideoInput></VideoInput>
115
  </div>
116
  {/if}
117
- <div class={isImageMode ? 'col-start-2' : 'col-span-2'}>
118
  <ImagePlayer />
119
  </div>
120
- <div class="col-span-2">
121
  <Button on:click={toggleLcmLive} {disabled} classList={'text-lg my-1 p-2'}>
122
  {#if isLCMRunning}
123
  Stop
 
110
  {#if pipelineParams}
111
  <article class="my-3 grid grid-cols-1 gap-3 sm:grid-cols-2">
112
  {#if isImageMode}
113
+ <div class="sm:col-start-1">
114
  <VideoInput></VideoInput>
115
  </div>
116
  {/if}
117
+ <div class={isImageMode ? 'sm:col-start-2' : 'col-span-2'}>
118
  <ImagePlayer />
119
  </div>
120
+ <div class="sm:col-span-2">
121
  <Button on:click={toggleLcmLive} {disabled} classList={'text-lg my-1 p-2'}>
122
  {#if isLCMRunning}
123
  Stop
requirements.txt CHANGED
@@ -1,6 +1,5 @@
1
  git+https://github.com/huggingface/diffusers@6f1435332bc74e286af5e88014236e4cc712b747
2
- transformers==4.34.1
3
- gradio==3.50.2
4
  --extra-index-url https://download.pytorch.org/whl/cu121;
5
  torch==2.1.0
6
  fastapi==0.104.1
 
1
  git+https://github.com/huggingface/diffusers@6f1435332bc74e286af5e88014236e4cc712b747
2
+ transformers==4.35.2
 
3
  --extra-index-url https://download.pytorch.org/whl/cu121;
4
  torch==2.1.0
5
  fastapi==0.104.1