Giter Site home page Giter Site logo

Comments (5)

AUTOMATIC1111 avatar AUTOMATIC1111 commented on April 28, 2024

maybe

from stable-diffusion-webui.

Pipazoul avatar Pipazoul commented on April 28, 2024

Here a a version i've made, probably not the most optimized, I will make a pull request soon

To build you need to have in the same folder :

  • sd-v1-4.ckpt
  • webui.py
FROM pytorch/pytorch:latest

# Make RUN commands use `bash --login`:
SHELL ["/bin/bash", "--login", "-c"]

RUN apt update
RUN apt install git curl -y

RUN apt-get update -yq \
    && apt-get -yq install curl gnupg ca-certificates \
    && curl -L https://deb.nodesource.com/setup_12.x | bash \
    && apt-get update -yq \
    && apt-get install -yq \
        nodejs

RUN apt install -y wget

RUN npm install -g localtunnel

WORKDIR /app

RUN git clone https://github.com/CompVis/stable-diffusion.git
WORKDIR /app/stable-diffusion

RUN conda env create -f environment.yaml
COPY webui.py ./
RUN mkdir models/ldm/stable-diffusion-v1/
RUN mkdir embeddings
RUN apt install wget -y
RUN wget -P embeddings/ url-to-my-emmbeding.pt


COPY sd-v1-4.ckpt /app/stable-diffusion/models/ldm/stable-diffusion-v1/model.ckpt


SHELL ["conda", "run", "-n", "ldm", "/bin/bash", "-c"]

RUN git clone https://github.com/TencentARC/GFPGAN.git
WORKDIR /app/stable-diffusion/GFPGAN
RUN pip install -r requirements.txt
RUN wget -P experiments/pretrained_models/ https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth



WORKDIR /app/stable-diffusion/
RUN pip install opencv-python
RUN apt update && apt install -y libsm6 libxext6
RUN apt-get install -y libxrender-dev
RUN pip install realesrgan

RUN pip install gradio
RUN pip install git+https://github.com/crowsonkb/k-diffusion/


RUN mkdir outputs
RUN mkdir outputs/txt2img-samples
RUN mkdir outputs/img2img-samples
RUN mkdir outputs/extras-samples
RUN mkdir outputs/txt2img-samples/samples
RUN mkdir outputs/img2img-samples/samples
RUN mkdir outputs/extras-samples/samples

in the docker image you can launch the following commands
I've used local tunnel, to expose my app because I rent a distant GPU

cd /app/stable-diffusion
nohup bash -c "lt --port 8080 &" && sleep 4
conda run -n ldm python webui.py --gfpgan-dir GFPGAN --no-progressbar-hiding 

from stable-diffusion-webui.

Pipazoul avatar Pipazoul commented on April 28, 2024

You also can use the gradio share url in replacement of localtunnel

from stable-diffusion-webui.

jw-star avatar jw-star commented on April 28, 2024

thanks

from stable-diffusion-webui.

AndreaPi avatar AndreaPi commented on April 28, 2024

@Pipazoul are you still planning to make a PR? This could be very useful. I would also suggest adding an entrypoint.sh file that executes the commands you should otherwise run in the Docker container. In other words, you could modify the Dockerfile adding these lines:

EXPOSE 8080
COPY ./entrypoint.sh /sd/
ENTRYPOINT /sd/entrypoint.sh

and include an entrypoint.sh file which contains the following:

#!/bin/bash
cd /app/stable-diffusion
nohup bash -c "lt --port 8080 &" && sleep 4
conda run -n ldm python webui.py --gfpgan-dir GFPGAN --no-progressbar-hiding 

Does it work on your side?

from stable-diffusion-webui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.