Yasunori Ozaki
commited on
Commit
·
71eda69
1
Parent(s):
ce0a8a4
Add model
Browse files- .gitattributes +1 -0
- README.md +27 -13
- v2-1-0.ckpt +3 -0
.gitattributes
CHANGED
|
@@ -32,3 +32,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
v2-1-0.ckpt filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -4,13 +4,13 @@ tags:
|
|
| 4 |
- stable-diffusion
|
| 5 |
- text-to-image
|
| 6 |
widget:
|
| 7 |
-
- text: "anime, a
|
| 8 |
example_title: "Girl (Anime)"
|
| 9 |
-
- text: "manga, monochrome, a
|
| 10 |
example_title: "Girl (Manga)"
|
| 11 |
-
- text: "anime, buildings in Tokyo, 4k, detailed"
|
| 12 |
example_title: "Bldgs. (Anime)"
|
| 13 |
-
- text: "manga, monochrome, buildings in Tokyo, highly detailed"
|
| 14 |
example_title: "Bldgs. (Manga)"
|
| 15 |
---
|
| 16 |
|
|
@@ -23,7 +23,16 @@ widget:
|
|
| 23 |
English version is [here](README_en.md).
|
| 24 |
|
| 25 |
# はじめに
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
# 法律や倫理について
|
| 29 |
本モデルは日本にて作成されました。したがって、日本の法律が適用されます。
|
|
@@ -34,13 +43,14 @@ English version is [here](README_en.md).
|
|
| 34 |
|
| 35 |
しかし、本モデルを配布する行為が倫理的に良くないとは作者は思っています。
|
| 36 |
これは学習する著作物に対して著作者の許可を得ていないためです。
|
| 37 |
-
|
| 38 |
したがって、法的な側面ではなく、倫理的な側面を調査する目的も本配布は兼ねていると考えてください。
|
| 39 |
|
| 40 |
# 使い方
|
| 41 |
手軽に楽しみたい方は、パソコンならば右上側にあるテキストフォームに入れて生成してみてください。
|
| 42 |
スマートフォンならば、上に戻って生成してみてください。
|
| 43 |
-
詳しい本モデルの取り扱い方は[
|
|
|
|
| 44 |
|
| 45 |
以下、一般的なモデルカードの日本語訳です。
|
| 46 |
|
|
@@ -71,7 +81,7 @@ Stable Diffusion v2と同じ使い方です。
|
|
| 71 |
|
| 72 |
### Web UIの場合
|
| 73 |
|
| 74 |
-
こちらの[取扱説明書](https://
|
| 75 |
|
| 76 |
### Diffusersの場合
|
| 77 |
|
|
@@ -86,18 +96,21 @@ pip install --upgrade git+https://github.com/huggingface/diffusers.git transform
|
|
| 86 |
次のスクリプトを実行し、画像を生成してください。
|
| 87 |
|
| 88 |
```python
|
| 89 |
-
from diffusers import StableDiffusionPipeline
|
| 90 |
import torch
|
| 91 |
|
| 92 |
-
model_id = "aipicasso/cool-japan-diffusion-2-1-0"
|
| 93 |
|
| 94 |
-
|
|
|
|
| 95 |
pipe = pipe.to("cuda")
|
| 96 |
|
| 97 |
-
prompt = "anime, a
|
| 98 |
-
|
|
|
|
| 99 |
|
| 100 |
image.save("girl.png")
|
|
|
|
| 101 |
```
|
| 102 |
|
| 103 |
**注意**:
|
|
@@ -144,6 +157,7 @@ image.save("girl.png")
|
|
| 144 |
# 使用してはいけない用途や悪意のある用途
|
| 145 |
- デジタル贋作 ([Digital Forgery](https://arxiv.org/abs/2212.03860)) は公開しないでください(著作権法に違反するおそれ)
|
| 146 |
- 特に既存のキャラクターは公開しないでください(著作権法に違反するおそれ)
|
|
|
|
| 147 |
- 他人の作品を無断でImage-to-Imageしないでください(著作権法に違反するおそれ)
|
| 148 |
- わいせつ物を頒布しないでください (刑法175条に違反するおそれ)
|
| 149 |
- いわゆる業界のマナーを守らないようなこと
|
|
|
|
| 4 |
- stable-diffusion
|
| 5 |
- text-to-image
|
| 6 |
widget:
|
| 7 |
+
- text: "anime, ilya, a portrait of a girl with black short hair and red eyes, kimono, full color illustration, official art, 4k, detailed"
|
| 8 |
example_title: "Girl (Anime)"
|
| 9 |
+
- text: "manga, monochrome, black and white manga, shojo manga, a portrait of a girl with black short hair and white eyes, school uniform, 4k, detailed"
|
| 10 |
example_title: "Girl (Manga)"
|
| 11 |
+
- text: "anime, buildings in Tokyo, 4k, 8k, highly detailed"
|
| 12 |
example_title: "Bldgs. (Anime)"
|
| 13 |
+
- text: "manga, black and white manga, monochrome, buildings in Tokyo, 4k, 8k, highly detailed"
|
| 14 |
example_title: "Bldgs. (Manga)"
|
| 15 |
---
|
| 16 |
|
|
|
|
| 23 |
English version is [here](README_en.md).
|
| 24 |
|
| 25 |
# はじめに
|
| 26 |
+
Cool Japan Diffusion (for learning) はStable Diffsionをファインチューニングして、アニメやマンガ、ゲームなどのクールジャパンを表現することに特化したモデルです。なお、内閣府のクールジャパン戦略とは特に関係はありません。
|
| 27 |
+
|
| 28 |
+
# ライセンスについて
|
| 29 |
+
ライセンスについては、もとのライセンス CreativeML Open RAIL++-M License に例外を除き商用利用禁止を追加しただけです。
|
| 30 |
+
例外を除き商用利用禁止を追加した理由は創作業界に悪影響を及ぼしかねないという懸念からです。
|
| 31 |
+
この懸念が払拭されれば、次のバージョンから元のライセンスに戻し、商用利用可能とします。
|
| 32 |
+
ちなみに、元のライセンスの日本語訳は[こちら](https://qiita.com/robitan/items/887d9f3153963114823d)になります。
|
| 33 |
+
営利企業にいる方は法務部にいる人と相談してください。
|
| 34 |
+
趣味で利用する方はあまり気にしなくても一般常識を守れば大丈夫なはずです。
|
| 35 |
+
なお、ライセンスにある通り、このモデルを改造しても、このライセンスを引き継ぐ必要があります。
|
| 36 |
|
| 37 |
# 法律や倫理について
|
| 38 |
本モデルは日本にて作成されました。したがって、日本の法律が適用されます。
|
|
|
|
| 43 |
|
| 44 |
しかし、本モデルを配布する行為が倫理的に良くないとは作者は思っています。
|
| 45 |
これは学習する著作物に対して著作者の許可を得ていないためです。
|
| 46 |
+
ただし、学習するには著作者の許可は法律上必要もなく、検索エンジンと同様法律上は問題はありません。
|
| 47 |
したがって、法的な側面ではなく、倫理的な側面を調査する目的も本配布は兼ねていると考えてください。
|
| 48 |
|
| 49 |
# 使い方
|
| 50 |
手軽に楽しみたい方は、パソコンならば右上側にあるテキストフォームに入れて生成してみてください。
|
| 51 |
スマートフォンならば、上に戻って生成してみてください。
|
| 52 |
+
詳しい本モデルの取り扱い方は[こちらの取扱説明書](https://alfredplpl.hatenablog.com/entry/2022/12/30/102636)にかかれています。
|
| 53 |
+
モデルは[ここ](https://huggingface.co/aipicasso/cool-japan-diffusion-2-1-0-beta/resolve/main/v2-1-0-beta.ckpt)からダウンロードできます。
|
| 54 |
|
| 55 |
以下、一般的なモデルカードの日本語訳です。
|
| 56 |
|
|
|
|
| 81 |
|
| 82 |
### Web UIの場合
|
| 83 |
|
| 84 |
+
こちらの[取扱説明書](https://alfredplpl.hatenablog.com/entry/2022/12/30/102636)に従って作成してください。
|
| 85 |
|
| 86 |
### Diffusersの場合
|
| 87 |
|
|
|
|
| 96 |
次のスクリプトを実行し、画像を生成してください。
|
| 97 |
|
| 98 |
```python
|
| 99 |
+
from diffusers import StableDiffusionPipeline, EulerDiscreteScheduler
|
| 100 |
import torch
|
| 101 |
|
| 102 |
+
model_id = "aipicasso/cool-japan-diffusion-2-1-0-beta"
|
| 103 |
|
| 104 |
+
scheduler = EulerDiscreteScheduler.from_pretrained(model_id, subfolder="scheduler")
|
| 105 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, scheduler=scheduler, torch_dtype=torch.float16)
|
| 106 |
pipe = pipe.to("cuda")
|
| 107 |
|
| 108 |
+
prompt = "anime, a portrait of a girl with black short hair and red eyes, kimono, full color illustration, official art, 4k, detailed"
|
| 109 |
+
negative_prompt="low quality, bad face, bad anatomy, bad hand, lowres, jpeg artifacts, 2d, 3d, cg, text"
|
| 110 |
+
image = pipe(prompt,negative_prompt=negative_prompt).images[0]
|
| 111 |
|
| 112 |
image.save("girl.png")
|
| 113 |
+
|
| 114 |
```
|
| 115 |
|
| 116 |
**注意**:
|
|
|
|
| 157 |
# 使用してはいけない用途や悪意のある用途
|
| 158 |
- デジタル贋作 ([Digital Forgery](https://arxiv.org/abs/2212.03860)) は公開しないでください(著作権法に違反するおそれ)
|
| 159 |
- 特に既存のキャラクターは公開しないでください(著作権法に違反するおそれ)
|
| 160 |
+
- なお、学習していない[キャラクターも生成できる](https://twitter.com/ThePioneerJPnew/status/1609074173892235264?s=20&t=-rY1ufzNeIDT3Fm5YdME6g)そうです。(このツイート自体は研究目的として許可しています。)
|
| 161 |
- 他人の作品を無断でImage-to-Imageしないでください(著作権法に違反するおそれ)
|
| 162 |
- わいせつ物を頒布しないでください (刑法175条に違反するおそれ)
|
| 163 |
- いわゆる業界のマナーを守らないようなこと
|
v2-1-0.ckpt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:839b169c31a730e39f445c92da722f68b4b16987c81ca1624ef114c120712282
|
| 3 |
+
size 5214965741
|