Merge pull request #73 from hodanov/feature/rename_directories
Feature/rename directories
This commit is contained in:
15 files changed
+19
-18
No files matched your search
@@ -3,8 +3,9 @@ name: Docker image CI
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- setup_files/Dockerfile
|
||||
- setup_files/requirements.txt
|
||||
- app/Dockerfile
|
||||
- app/requirements.txt
|
||||
- .github/workflows/docker_image_ci.yml
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -13,5 +14,5 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build the Docker image
|
||||
run: |
|
||||
cd setup_files
|
||||
cd app
|
||||
docker build . -f Dockerfile
|
||||
@@ -1,5 +1,5 @@
|
||||
app:
|
||||
cd ./setup_files && modal deploy __main__.py
|
||||
cd ./app && modal deploy __main__.py
|
||||
|
||||
# `--upscaler` is a name of upscaler you want to use.
|
||||
# You can use upscalers the below:
|
||||
@@ -8,7 +8,7 @@ app:
|
||||
# - `RealESRGAN_x4plus_anime_6B`
|
||||
# - `RealESRGAN_x2plus`
|
||||
img_by_sd15_txt2img:
|
||||
cd ./sdcli && modal run sd15_txt2img.py \
|
||||
cd ./cmd && modal run sd15_txt2img.py \
|
||||
--prompt "a photograph of an astronaut riding a horse" \
|
||||
--n-prompt "" \
|
||||
--height 512 \
|
||||
@@ -21,7 +21,7 @@ img_by_sd15_txt2img:
|
||||
--output-format "avif"
|
||||
|
||||
img_by_sd15_img2img:
|
||||
cd ./sdcli && modal run sd15_img2img.py \
|
||||
cd ./cmd && modal run sd15_img2img.py \
|
||||
--prompt "cat wizard, gandalf, lord of the rings, detailed, fantasy, cute, adorable, Pixar, Disney, 8k" \
|
||||
--n-prompt "" \
|
||||
--samples 1 \
|
||||
@@ -33,7 +33,7 @@ img_by_sd15_img2img:
|
||||
--base-image-url "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png"
|
||||
|
||||
img_by_sdxl_txt2img:
|
||||
cd ./sdcli && modal run sdxl_txt2img.py \
|
||||
cd ./cmd && modal run sdxl_txt2img.py \
|
||||
--prompt "A dog is running on the grass" \
|
||||
--height 1024 \
|
||||
--width 1024 \
|
||||
|
||||
@@ -42,7 +42,7 @@ Please see [the documentation of Modal](https://modal.com/docs/guide) for modals
|
||||
To use the script, execute the below.
|
||||
|
||||
1. git clone the repository.
|
||||
2. Copy `./setup_files/config.sample.yml` to `./setup_files/config.yml`
|
||||
2. Copy `./app/config.sample.yml` to `./app/config.yml`
|
||||
3. Open the Makefile and set prompts.
|
||||
4. Execute `make app` command. An application will be deployed to Modal.
|
||||
5. Execute `make img_by_sd15_txt2img` command.
|
||||
@@ -56,13 +56,13 @@ Images are generated and output to the `outputs/` directory.
|
||||
├── .env # Secrets manager
|
||||
├── Makefile
|
||||
├── README.md
|
||||
├── sdcli/ # A directory with scripts to run inference.
|
||||
├── cmd/ # A directory with scripts to run inference.
|
||||
│ ├── outputs/ # Images are outputted this directory.
|
||||
│ ├── sd15_img2img.py # A script to run sd15_img2img inference.
|
||||
│ ├── sd15_txt2img.py # A script to run sd15_txt2img inference.
|
||||
│ ├── sdxl_txt2img.py # A script to run sdxl_txt2img inference.
|
||||
│ └── util.py
|
||||
└── setup_files/ # A directory with config files.
|
||||
└── app/ # A directory with config files.
|
||||
├── __main__.py # A main script to run inference.
|
||||
├── Dockerfile # To build a base image.
|
||||
├── config.yml # To set a model, vae and some tools.
|
||||
@@ -91,7 +91,7 @@ This script downloads and uses a model from HuggingFace, but if you want to use
|
||||
HUGGING_FACE_TOKEN="Write your hugging face token here."
|
||||
```
|
||||
|
||||
### 3. Add the model to ./setup_files/config.yml
|
||||
### 3. Add the model to ./app/config.yml
|
||||
|
||||
Add the model used for inference. Use the Safetensors file as is. VAE, LoRA, and Textual Inversion are also configurable.
|
||||
|
||||
@@ -124,7 +124,7 @@ Set the prompt to Makefile.
|
||||
```makefile
|
||||
# ex)
|
||||
run:
|
||||
cd ./sdcli && modal run txt2img.py \
|
||||
cd ./cmd && modal run txt2img.py \
|
||||
--prompt "hogehoge" \
|
||||
--n-prompt "mogumogu" \
|
||||
--height 768 \
|
||||
|
||||
+5
-5
@@ -44,7 +44,7 @@ modal token new
|
||||
下記の手順で画像が生成され、outputs ディレクトリに出力されます。
|
||||
|
||||
1. リポジトリをgit clone
|
||||
2. ./setup_files/config.example.yml を ./setup_files/config.ymlにコピー
|
||||
2. ./app/config.example.yml を ./app/config.ymlにコピー
|
||||
3. Makefile を開いてプロンプトを設定
|
||||
4. make appをコマンドラインで実行(Modal上にアプリケーションが構築されます)
|
||||
5. make img_by_sd15_txt2img(スクリプトが起動します)
|
||||
@@ -56,13 +56,13 @@ modal token new
|
||||
├── .env # Secrets manager
|
||||
├── Makefile
|
||||
├── README.md
|
||||
├── sdcli/ # A directory with scripts to run inference.
|
||||
├── cmd/ # A directory with scripts to run inference.
|
||||
│ ├── outputs/ # Images are outputted this directory.
|
||||
│ ├── sd15_img2img.py # A script to run sd15_img2img inference.
|
||||
│ ├── sd15_txt2img.py # A script to run sd15_txt2img inference.
|
||||
│ ├── sdxl_txt2img.py # A script to run sdxl_txt2img inference.
|
||||
│ └── util.py
|
||||
└── setup_files/ # A directory with config files.
|
||||
└── app/ # A directory with config files.
|
||||
├── __main__.py # A main script to run inference.
|
||||
├── Dockerfile # To build a base image.
|
||||
├── config.yml # To set a model, vae and some tools.
|
||||
@@ -91,7 +91,7 @@ Hugging FaceのトークンをHUGGING_FACE_TOKENに記入します。
|
||||
HUGGING_FACE_TOKEN="ここにHuggingFaceのトークンを記載する"
|
||||
```
|
||||
|
||||
### 3. ./setup_files/config.ymlを設定する
|
||||
### 3. ./app/config.ymlを設定する
|
||||
|
||||
推論に使うモデルを設定します。Safetensorsファイルをそのまま利用します。VAE、LoRA、Textual Inversionも設定可能です。
|
||||
|
||||
@@ -126,7 +126,7 @@ loras:
|
||||
```makefile
|
||||
# 設定例
|
||||
run:
|
||||
cd ./sdcli && modal run txt2img.py \
|
||||
cd ./cmd && modal run txt2img.py \
|
||||
--prompt "hogehoge" \
|
||||
--n-prompt "mogumogu" \
|
||||
--height 768 \
|
||||
|
||||
File renamed without changes.
File renamed without changes.
@@ -1,7 +1,7 @@
|
||||
##########
|
||||
# This is the config file to set a base model, vae and some tools.
|
||||
# Rename the file to `config.yml` before running the script.
|
||||
# Execute `modal deploy ./setup_files/setup.py` every time modify this file.
|
||||
# Execute `modal deploy ./app/setup.py` every time modify this file.
|
||||
##########
|
||||
|
||||
##########
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user