diff --git a/.gitignore b/.gitignore index bee8a64b..5b668843 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ __pycache__ +installer +installer.tar +dist \ No newline at end of file diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 01014ae5..00000000 --- a/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM python:3.9 - -RUN mkdir /app -WORKDIR /app - -RUN apt update - -COPY requirements.txt ./ -RUN pip install --no-cache-dir -r requirements.txt - -COPY . . - -EXPOSE 9000 - -ENTRYPOINT ["uvicorn", "main:app", "--reload", "--host", "0.0.0.0", "--port", "9000"] \ No newline at end of file diff --git a/How to install and run.txt b/How to install and run.txt new file mode 100644 index 00000000..2f35d75b --- /dev/null +++ b/How to install and run.txt @@ -0,0 +1,24 @@ +Congrats on downloading Stable Diffusion UI, version 2! + +If you haven't downloaded Stable Diffusion UI yet, please download from https://github.com/cmdr2/stable-diffusion-ui + +After downloading, to install please follow these instructions: + +For Windows: +- Please double-click the "Start Stable Diffusion UI.cmd" file inside the "stable-diffusion-ui" folder. + +For Linux: +- Please open a terminal, and go to the "stable-diffusion-ui" directory. Then run ./start.sh + +That file will automatically install everything. After that it will start the Stable Diffusion interface in a web browser. + +To start the UI in the future, please run the same command mentioned above. + + +If you have any problems, please: +1. Try the troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting +2. Or, seek help from the community at https://discord.com/invite/u9yhsFmEkB +3. Or, file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues + +Thanks +cmdr2 (and contributors to the project) \ No newline at end of file diff --git a/OldPortDockerfile b/OldPortDockerfile deleted file mode 100644 index 22990ee2..00000000 --- a/OldPortDockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM python:3.9 - -RUN mkdir /app -WORKDIR /app - -RUN apt update - -COPY requirements.txt ./ -RUN pip install --no-cache-dir -r requirements.txt - -COPY . . - -EXPOSE 8000 - -ENTRYPOINT ["uvicorn", "old_port_main:app", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file diff --git a/build.bat b/build.bat new file mode 100644 index 00000000..e5e30b6a --- /dev/null +++ b/build.bat @@ -0,0 +1,39 @@ +@mkdir dist\stable-diffusion-ui + +@echo "Downloading components for the installer.." + +@call conda env create --prefix installer -f environment.yaml +@call conda activate .\installer + +@echo "Setting up startup scripts.." + +@mkdir installer\etc\conda\activate.d +@copy scripts\post_activate.bat installer\etc\conda\activate.d\ + +@echo "Creating a distributable package.." + +@call conda install -c conda-forge -y conda-pack +@call conda pack --n-threads -1 --prefix installer --format tar + +@cd dist\stable-diffusion-ui +@mkdir installer + +@call tar -xf ..\..\installer.tar -C installer + +@mkdir scripts + +@copy ..\..\scripts\on_env_start.bat scripts\ +@copy "..\..\scripts\Start Stable Diffusion UI.cmd" . +@copy ..\..\LICENSE . +@copy "..\..\CreativeML Open RAIL-M License" . +@copy "..\..\How to install and run.txt" . + +@echo "Build ready. Zip the 'dist\stable-diffusion-ui' folder." + +@echo "Cleaning up.." + +@cd ..\.. + +@rmdir /s /q installer + +@del installer.tar \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100644 index 00000000..582f81da --- /dev/null +++ b/build.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +mkdir -p dist/stable-diffusion-ui + +echo "Downloading components for the installer.." + +source ~/miniconda3/etc/profile.d/conda.sh + +conda install -c conda-forge -y conda-pack + +conda env create --prefix installer -f environment.yaml +conda activate ./installer + +echo "Creating a distributable package.." + +conda pack --n-threads -1 --prefix installer --format tar + +cd dist/stable-diffusion-ui +mkdir installer + +tar -xf ../../installer.tar -C installer + +mkdir scripts + +cp ../../scripts/on_env_start.sh scripts/ +cp "../../scripts/start.sh" . +cp ../../LICENSE . +cp "../../CreativeML Open RAIL-M License" . +cp "../../How to install and run.txt" . + +echo "Build ready. Zip the 'dist/stable-diffusion-ui' folder." + +echo "Cleaning up.." + +cd ../.. + +rm -rf installer + +rm installer.tar \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 584b63c2..00000000 --- a/docker-compose.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: '3.3' - -services: - stability-ai: - container_name: sd - ports: - - '5000:5000' - image: 'r8.im/stability-ai/stable-diffusion@sha256:be04660a5b93ef2aff61e3668dedb4cbeb14941e62a3fd5998364a32d613e35e' - deploy: - resources: - reservations: - devices: - - capabilities: [gpu] - - stable-diffusion-ui: - container_name: sd-ui - ports: - - '9000:9000' - build: - context: . - dockerfile: Dockerfile - volumes: - - .:/app - depends_on: - - stability-ai - -networks: - default: diff --git a/environment.yaml b/environment.yaml new file mode 100644 index 00000000..6ac07d5c --- /dev/null +++ b/environment.yaml @@ -0,0 +1,7 @@ +name: stable-diffusion-ui-installer +channels: + - defaults + - conda-forge +dependencies: + - conda + - git diff --git a/index.html b/index.html deleted file mode 100644 index 6d71d3bd..00000000 --- a/index.html +++ /dev/null @@ -1,912 +0,0 @@ - - - - - - -
-
-
-
-
-
 
- server starting.. -
-

Stable Diffusion UI v1

-
-
-
- - -
- -
-
-
- - -
- -
-
-
- - -
-
-
- -
- -
-
-
- - -
- -
 
- -
-

Advanced Settings

-
    -
  • -
  • -
  • - -
  • -
  • - -
  • -
  • -
  • -

  • -
  •  
  • -
  • -
-
- -
-

Image Modifiers (art styles, tags etc)

-
-
-
-
- -
-
Type a prompt and press the "Make Image" button.

You can also add modifiers like "Realistic", "Pencil Sketch", "ArtStation" etc by browsing through the "Image Modifiers" section and selecting the desired modifiers.

Click "Advanced Settings" for additional settings like seed, image size, number of images to generate etc.

Enjoy! :)
- -
-
-
-
-
- -
 
- - -
- - - - - - diff --git a/main.py b/main.py deleted file mode 100644 index 5d65b488..00000000 --- a/main.py +++ /dev/null @@ -1,73 +0,0 @@ -from fastapi import FastAPI, HTTPException -from starlette.responses import FileResponse -from pydantic import BaseModel - -import requests - -LOCAL_SERVER_URL = 'http://stability-ai:5000' -PREDICT_URL = LOCAL_SERVER_URL + '/predictions' - -app = FastAPI() - -# defaults from https://huggingface.co/blog/stable_diffusion -class ImageRequest(BaseModel): - prompt: str - init_image: str = None # base64 - mask: str = None # base64 - num_outputs: str = "1" - num_inference_steps: str = "50" - guidance_scale: str = "7.5" - width: str = "512" - height: str = "512" - seed: str = "30000" - prompt_strength: str = "0.8" - -@app.get('/') -def read_root(): - return FileResponse('index.html') - -@app.get('/ping') -async def ping(): - try: - requests.get(LOCAL_SERVER_URL) - return {'OK'} - except: - return {'ERROR'} - -@app.post('/image') -async def image(req : ImageRequest): - data = { - "input": { - "prompt": req.prompt, - "num_outputs": req.num_outputs, - "num_inference_steps": req.num_inference_steps, - "width": req.width, - "height": req.height, - "seed": req.seed, - "guidance_scale": req.guidance_scale, - } - } - - if req.init_image is not None: - data['input']['init_image'] = req.init_image - data['input']['prompt_strength'] = req.prompt_strength - - if req.mask is not None: - data['input']['mask'] = req.mask - - if req.seed == "-1": - del data['input']['seed'] - - res = requests.post(PREDICT_URL, json=data) - if res.status_code != 200: - raise HTTPException(status_code=500, detail=res.text) - - return res.json() - -@app.get('/media/ding.mp3') -def read_root(): - return FileResponse('media/ding.mp3') - -@app.get('/modifiers.json') -def read_modifiers(): - return FileResponse('modifiers.json') diff --git a/media/config-v5.jpg b/media/config-v5.jpg new file mode 100644 index 00000000..a23267f4 Binary files /dev/null and b/media/config-v5.jpg differ diff --git a/modifiers.json b/modifiers.json deleted file mode 100644 index 692de138..00000000 --- a/modifiers.json +++ /dev/null @@ -1,92 +0,0 @@ -[ - ["Drawing Style", [ - "Sketch", - "Doodle", - "Children's Drawing", - "Line Art", - "Dot Art", - "Crosshatch", - "Detailed and Intricate", - "Cel Shading" - ]], - ["Visual Style", [ - "2D", - "Cartoon", - "8-bit", - "16-bit", - "Graphic Novel", - "Visual Novel", - "Street Art", - "Fantasy", - "Realistic", - "Photo", - "Hard Edge Painting", - "Mural", - "Mosaic", - "Hydrodipped", - "Modern Art", - "Concept Art", - "Digital Art", - "CGI", - "Anaglyph", - "Comic Book", - "Lithography" - ]], - ["Pen", [ - "Graphite", - "Colored Pencil", - "Ink", - "Chalk", - "Pastel Art", - "Oil Paint" - ]], - ["Carving and Etching", [ - "Etching", - "Wood-Carving", - "Papercutting", - "Paper-Mache", - "Paper Model", - "Linocut", - "Pyrography" - ]], - ["Camera", [ - "HD", - "Color Grading", - "Film Grain", - "White Balance", - "Golden Hour", - "Glamor Shot", - "War Photography", - "Lens Flare", - "Polaroid", - "Vintage" - ]], - ["Color", [ - "Colorful", - "Electric Colors", - "Warm Color Palette", - "Infrared", - "Beautiful Lighting" - ]], - ["Emotions", [ - "Happy", - "Excited", - "Sad", - "Lonely", - "Angry", - "Good", - "Evil" - ]], - ["Style of an artist or community", [ - "by Andy Warhol", - "Artstation", - "by Asaf Hanuka", - "by Aubrey Beardsley", - "by H.R. Giger", - "by Hayao Mizaki", - "by Salvador Dali", - "by Tivadar Csontváry Kosztka", - "by Lisa Frank", - "by Pablo Piccaso" - ]] -] \ No newline at end of file diff --git a/old_port_main.py b/old_port_main.py deleted file mode 100644 index 432ea847..00000000 --- a/old_port_main.py +++ /dev/null @@ -1,36 +0,0 @@ -from fastapi import FastAPI -from fastapi.responses import HTMLResponse - -app = FastAPI() - -@app.get('/', response_class=HTMLResponse) -def read_root(): - return ''' - -

The UI has moved to http://localhost:9000. The current address that you used (ending with :8000) will be removed in the future, so please use http://localhost:9000 going ahead (and in any bookmarks you've saved).

- -

Why has the address changed?

-

The previously used port (8000) is often used by other servers, which results in port conflicts. So the project's port number has been changed, while the project is still young. Otherwise port-conflicts with 8000 will be a common source of new-user issues in the future.

-

Sorry about this, and apologies for the inconvenience :)

- ''' diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 6d9c7c3f..00000000 --- a/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -requests -fastapi==0.80.0 -uvicorn==0.18.2 diff --git a/server b/server deleted file mode 100755 index 849154b4..00000000 --- a/server +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -echo "Please use 'docker-compose up &' to start the server, and 'docker-compose down' to stop the server" \ No newline at end of file