Skip to content

Instantly share code, notes, and snippets.

@safa-dayo
safa-dayo / ddim-animate-diff-support.py
Created August 30, 2023 21:42
Stable Diffusion web UIでAnimateDiffを利用する際に用いるDDIM関連のファイルとなります。詳細はソースコード冒頭のコメントを参照してください。
"""SAMPLING ONLY."""
"""
ファイル名: ddim.py
概要:
このファイルは以下のTDSさんのnoteを参考に、コード内容を修正したddim.pyとなります。
https://note.com/tds_/n/n5aad9ef8a9b1
上のnoteに記載されている new_schedule.json がStable Diffusion web UIのルート配下に配置されていないと正常に動きません。
@safa-dayo
safa-dayo / sd-webui-google-colab-setup.sh
Last active April 2, 2025 14:55
Stable Diffusion web UI(最新版)をGoogle Colabで起動するためのコマンド。こちらのコマンドを自身のGoogle Colabノートブックにコピーした後、利用したいモデルや拡張機能、LoRAなどにチェックを入れた上で実行ボタンを押すことで、設定した内容でStable Diffusion web UIが起動します。
#@title Stable Diffusion web UI(最新版)をGoogle Colabで起動するためのコマンド
#@markdown ## このColabノートブックについて
#@markdown [Stable Diffusion web UI](https://github.com/AUTOMATIC1111/stable-diffusion-webui) をGoogle Colabで起動するためのノートブックとなります。
#@markdown 利用したいモデルや拡張機能、LoRAなどにチェックを入れた上で実行ボタンを押すことで、設定した内容でStable Diffusion web UIが起動します。
#@markdown また各項目には公式ページへのリンクをつけています。利用の際は公式ページよりライセンスなどを確認した上でご利用ください。
### Stable Diffusion web UIインストール
@safa-dayo
safa-dayo / start-sdwebui-v1.5.sh
Last active July 29, 2023 22:20
Stable Diffusion web UI v1.5系をGoogle Colabで構築するためのコマンド
### Stable Diffusion web UI v.1.5系を起動するためのコマンド ###
# ランタイムの設定: T4・ハイメモリ以上を推奨
#
# 利用モデル:
# SDXL base 1.0
# DreamShaper XL 0.9 Alpha(コメントアウトした状態になっているので、利用する際はコメントを外してください)
#
# 利用する拡張機能: After Detailer
# stable diffusion webuiのリポジトリをクローンして、クローンしたフォルダに移動
@safa-dayo
safa-dayo / sdwebui-animate-diff.sh
Last active August 25, 2023 02:00
Google Colabを用いて、Stable Diffusion web UIの拡張機能である、AnimateDiffを利用するための環境構築コマンド
### AnimateDiffを利用するための環境構築コマンド ###
# stable diffusion webuiのリポジトリをクローンして、クローンしたフォルダに移動
!git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
%cd /content/stable-diffusion-webui
# ライブラリのバージョンでエラーになるため以下を実施
!pip install torch==2.0.0+cu118 torchdata==0.6.0 torchtext==0.15.1 torchvision==0.15.1+cu118 torchaudio==2.0.1 --index-url https://download.pytorch.org/whl/cu118
# v1.5.1を利用する
!git checkout tags/v1.5.1
@safa-dayo
safa-dayo / download-sdwebui-output-images.sh
Last active July 21, 2023 04:03
Google Colab上で動くStable Diffusion web UIで生成した画像を、ZIPにまとめてダウンロードするためのコマンド
### 使い方 ###
# Google Colab上で空のコードブロックを一つ追加し、こちらのコードを挿入して実行すれば、生成画像のダウンロード処理が開始されます
# 実行する際はStable Diffusion web UIの実行は停止した上で行う必要があります
#############
# ZIP化
!zip -r /content/file.zip /content/stable-diffusion-webui/outputs/
# ダウンロード
from google.colab import files
@safa-dayo
safa-dayo / start-sdwebui-v1.4.sh
Last active August 2, 2023 12:09
Stable Diffusion web UI v1.4系をGoogle Colabで構築するためのコマンド
# stable diffusion webuiのリポジトリをクローンして、クローンしたフォルダに移動
!git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
%cd /content/stable-diffusion-webui
# ライブラリのバージョンでエラーになるため以下を実施
!pip install torch==2.0.0+cu118 torchdata==0.6.0 torchtext==0.15.1 torchvision==0.15.1+cu118 torchaudio==2.0.1 --index-url https://download.pytorch.org/whl/cu118
# v1.4.1を利用する
!git checkout tags/v1.4.1
@safa-dayo
safa-dayo / sdwebui-extensions-download-at-google-colab.sh
Created June 19, 2023 02:38
Stable Diffusion web UIの拡張機能をダウンロードする際に利用するGoogle Colab向けのダウンロードコマンド
### 方法1 ###
# 拡張機能の名称については https://~~~/foobar.git とURLがあった場合、 foobar のことを指します
!git clone {ここにダウンロードしたい拡張機能のURLを入力してください} /content/stable-diffusion-webui/extensions/{拡張機能の名称}
# 例:例えば拡張機能であるRembgをStable Diffusion web UIに導入するためのコマンドは以下となります
!git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui-rembg.git /content/stable-diffusion-webui/extensions/stable-diffusion-webui-rembg
### 方法2 ###
%cd /content/stable-diffusion-webui/extensions
!git clone {ここにダウンロードしたい拡張機能のURLを入力してください}
@safa-dayo
safa-dayo / sd-1.3.2-with-BracingEvoMix-3models.sh
Created June 15, 2023 23:12
Google Colab上でBracingEvoMixの3モデルを導入した状態でStable Diffusion web UIのv1.3.2の環境を構築するためのコマンドです。
### BracingEvoMix(3モデル)環境構築コマンド ###
# stable diffusion webuiのリポジトリをクローンして、クローンしたフォルダに移動
!git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
%cd /content/stable-diffusion-webui
# ライブラリのバージョンでエラーになるため以下を実施
!pip install torch==2.0.0+cu118 torchdata==0.6.0 torchtext==0.15.1 torchvision==0.15.1+cu118 torchaudio==2.0.1 --index-url https://download.pytorch.org/whl/cu118
# v1.3.2を利用する
!git checkout tags/v1.3.2
@safa-dayo
safa-dayo / sd-1.5.1-with-BracingEvoMix.sh
Last active August 2, 2023 22:35
Google Colab & Stable Diffusion web UI v1.5.1上でBracingEvoMixを使うための起動コマンド(ControlNetとEasyNegative付き)
# stable diffusion webuiのリポジトリをクローンして、クローンしたフォルダに移動
!git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
%cd /content/stable-diffusion-webui
# ライブラリのバージョンでエラーになるため以下を実施
!pip install torch==2.0.0+cu118 torchdata==0.6.0 torchtext==0.15.1 torchvision==0.15.1+cu118 torchaudio==2.0.1 --index-url https://download.pytorch.org/whl/cu118
# v1.5.1を利用する
!git checkout tags/v1.5.1
@safa-dayo
safa-dayo / start-sdwebui-v1.3.sh
Last active June 5, 2023 10:36
Stable Diffusion web UI v1.3系をGoogle Colabで構築するためのコマンド
# stable diffusion webuiのリポジトリをクローンして、クローンしたフォルダに移動
!git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
%cd /content/stable-diffusion-webui
# ライブラリのバージョンでエラーになるため以下を実施
!pip install torch==2.0.0+cu118 torchdata==0.6.0 torchtext==0.15.1 torchvision==0.15.1+cu118 torchaudio==2.0.1 --index-url https://download.pytorch.org/whl/cu118
# v1.3.2を利用する
!git checkout tags/v1.3.2