commit
						1d9370d687
					
				
							
								
								
									
										17
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								README.md
									
									
									
									
									
								
							@ -7,12 +7,12 @@ This is a Diffusers-based script for running Stable Diffusion on [Modal](https:/
 | 
			
		||||
## Features
 | 
			
		||||
 | 
			
		||||
1. Image generation using txt2img
 | 
			
		||||

 | 
			
		||||
   
 | 
			
		||||
 | 
			
		||||
2. Upscaling
 | 
			
		||||
 | 
			
		||||
| Before upscaling                                                 | After upscaling                                                  |
 | 
			
		||||
| ---- | ---- |
 | 
			
		||||
| ---------------------------------------------------------------- | ---------------------------------------------------------------- |
 | 
			
		||||
| <img src="assets/20230708204347_1172778945_0_0.png" width="300"> | <img src="assets/20230708204347_1172778945_0_2.png" width="300"> |
 | 
			
		||||
 | 
			
		||||
## Requirements
 | 
			
		||||
@ -105,9 +105,7 @@ controlnets:
 | 
			
		||||
    repo_id: lllyasviel/control_v11f1e_sd15_tile
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Use a model configured for Diffusers, such as the one found in [this repository](https://huggingface.co/stabilityai/stable-diffusion-2-1).
 | 
			
		||||
 | 
			
		||||
Files in safetensor format shared by Civitai etc. need to be converted (you can do so with a script in the diffusers official repository).
 | 
			
		||||
Use a model configured for Diffusers, such as the one found in [this repository](https://huggingface.co/stabilityai/stable-diffusion-2-1). Files in safetensor format shared by Civitai etc. need to be converted (you can do so with a script in the diffusers official repository).
 | 
			
		||||
 | 
			
		||||
[https://github.com/huggingface/diffusers/blob/main/scripts/convert_original_stable_diffusion_to_diffusers.py](https://github.com/huggingface/diffusers/blob/main/scripts/convert_original_stable_diffusion_to_diffusers.py)
 | 
			
		||||
 | 
			
		||||
@ -119,6 +117,15 @@ python ./diffusers/scripts/convert_original_stable_diffusion_to_diffusers.py --f
 | 
			
		||||
--device='cuda:0'
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
LoRA and Textual Inversion don't require any conversion and can directly use safetensors files. Add the download link to config.yml as below.
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
# Example
 | 
			
		||||
loras:
 | 
			
		||||
  - name: lora_name.safetensors # Specify the LoRA file name. Any name is fine, but the extension `.safetensors` is required.
 | 
			
		||||
    download_url: download_link_here # Specify the download link for the safetensor file.
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### 4. Setting prompts
 | 
			
		||||
 | 
			
		||||
Set the prompt to Makefile.
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										15
									
								
								README_ja.md
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								README_ja.md
									
									
									
									
									
								
							@ -11,7 +11,7 @@
 | 
			
		||||
2. アップスケーラーとControlNet Tileを利用した高解像度な画像を生成することができます。
 | 
			
		||||
 | 
			
		||||
| ベース画像                                                       | アップスケール後                                                 |
 | 
			
		||||
| ---- | ---- |
 | 
			
		||||
| ---------------------------------------------------------------- | ---------------------------------------------------------------- |
 | 
			
		||||
| <img src="assets/20230708204347_1172778945_0_0.png" width="300"> | <img src="assets/20230708204347_1172778945_0_2.png" width="300"> |
 | 
			
		||||
 | 
			
		||||
3. その他、LoRAとTextual inversionを利用できます。
 | 
			
		||||
@ -105,12 +105,19 @@ controlnets:
 | 
			
		||||
    repo_id: lllyasviel/control_v11f1e_sd15_tile
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
ModelとVAEは[こちらのリポジトリ](https://huggingface.co/stabilityai/stable-diffusion-2-1)にあるような、Diffusersのために構成されたモデルを利用します。
 | 
			
		||||
 | 
			
		||||
Civitaiなどで共有されているsafetensors形式のファイルは変換が必要です(diffusersの公式リポジトリにあるスクリプトで変換できます)。
 | 
			
		||||
ModelとVAEは[こちらのリポジトリ](https://huggingface.co/stabilityai/stable-diffusion-2-1)にあるような、Diffusersのために構成されたモデルを利用します。Civitaiなどで共有されているsafetensors形式のファイルは変換が必要です(diffusersの公式リポジトリにあるスクリプトで変換できます)。
 | 
			
		||||
 | 
			
		||||
[変換スクリプト](https://github.com/huggingface/diffusers/blob/main/scripts/convert_original_stable_diffusion_to_diffusers.py)
 | 
			
		||||
 | 
			
		||||
LoRAとTextual Inversionは変換不要で、safetensorsファイルをそのまま利用できます。
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
# 設定例
 | 
			
		||||
loras:
 | 
			
		||||
  - name: mecha.safetensors # ファイル名を指定。任意の名前で良いが、拡張子`.safetensors`は必須。
 | 
			
		||||
    download_url: https://civitai.com/api/download/models/150907?type=Model&format=SafeTensor # ダウンロードリンクを指定
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
# 変換スクリプトの使用例
 | 
			
		||||
python ./diffusers/scripts/convert_original_stable_diffusion_to_diffusers.py --from_safetensors \
 | 
			
		||||
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 562 KiB After Width: | Height: | Size: 172 KiB  | 
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 5.9 MiB After Width: | Height: | Size: 2.0 MiB  | 
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 2.5 MiB After Width: | Height: | Size: 574 KiB  | 
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user