koji commited on
Commit
707884d
1 Parent(s): 1a94bc1

README.mdにSpace用の情報を追加

Browse files
Files changed (2) hide show
  1. README.md +30 -14
  2. app.py +1 -1
README.md CHANGED
@@ -1,3 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
1
  ## Space App Toyohashi in Japan / 豊橋
2
 
3
  ### [Team X Alien (チーム星人)](https://2022.spaceappschallenge.org/challenges/2022-challenges/space-biology-superhero/teams/team-x-alien/project)
@@ -21,9 +32,11 @@
21
 
22
  ### Output Images by Image Generation / 画像生成により出力した画像
23
 
24
- ##### left: first Generation! Very Furry Tall Herd of No teeth Lighter skin Ferocious alien from Mars
25
- ##### center: 500th Generation! Pair Carnivorous Gentle alien from Mars
26
- ##### right: 1000th Generation! Pair Herbivorous Ferocious alien from Mars
 
 
27
 
28
  <div align="center">
29
  <img src="./sample_output_images/first_generation.png" alt="エビフライトライアングル" title="サンプル" style="width:240px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
@@ -36,6 +49,7 @@
36
  - Verify execution with M1 Mac, Python 3.7.13
37
 
38
  - On Colab
 
39
  - Open [StableDiffusionSample.ipynb on Colab](https://colab.research.google.com/drive/1Uaqmq3ibMmEwepnn4OWHf2TVboUVa14O?usp=sharing)
40
  - Upload simulation.py to the current directory of Colab
41
 
@@ -43,6 +57,7 @@
43
  - Install requirements.txt library in a virtual environment, etc.
44
 
45
  ### Command Example (Mac)
 
46
  ```
47
  # Create a virtual environment
48
  python -m venv .venv
@@ -57,21 +72,22 @@ python -m pip install --upgrade pip
57
  pip install -r requirements.txt
58
  ```
59
 
60
- - Launch notebook StableDiffusionByCpu.ipynb.
61
 
62
  - Common
63
  - Create a [Hugging Face](https://huggingface.co/) account.
64
  - Create an access token in [Hugging Face Setting](https://huggingface.co/settings/tokens).
65
- ![スクリーンショット 2022-10-05 21 30 00](https://user-images.githubusercontent.com/45703844/194060690-574e4ee2-be14-48f9-aa76-887ef32e737c.png)
66
  - Allow the use of the model you want to use (e.g. CompVis/stable-diffusion-v1-4), referring to the explanation on the official site.
67
  - Run a Colab or Local notebook, enter the Hugging Face token into the notebook, login and run the notebook.
68
- ![スクリーンショット 2022-10-05 21 33 06](https://user-images.githubusercontent.com/45703844/194061128-92b76dc0-cf2a-48c7-8930-8b3b3ab60405.png)
69
 
70
- ---------------------------------------------
71
 
72
  - M1 Mac, Python 3.7.13 で実行を確認
73
 
74
  - グーグルコラボ
 
75
  - [StableDiffusionSample.ipynb on Colab](https://colab.research.google.com/drive/1Uaqmq3ibMmEwepnn4OWHf2TVboUVa14O?usp=sharing)を開く
76
  - Colab のカレントディレクトリに simulation.py をアップロードする
77
 
@@ -79,6 +95,7 @@ pip install -r requirements.txt
79
  - 仮想環境などに requirements.txt のライブラリをインストールする
80
 
81
  ### コマンド例(Mac)
 
82
  ```
83
  # 仮想環境の作成
84
  python -m venv .venv
@@ -93,30 +110,29 @@ python -m pip install --upgrade pip
93
  pip install -r requirements.txt
94
  ```
95
 
96
- - stable_diffusion_cpu.ipynb を立ち上げる
97
 
98
  - 共通
99
  - [Hugging Face](https://huggingface.co/)のアカウントを作成する
100
  - [Hugging Face の Setting](https://huggingface.co/settings/tokens)でアクセストークンを作成する
101
- ![スクリーンショット 2022-10-05 21 30 00](https://user-images.githubusercontent.com/45703844/194060690-574e4ee2-be14-48f9-aa76-887ef32e737c.png)
102
  - [公式サイトの解説](https://huggingface.co/docs/hub/security-tokens)を参考に、使用するモデル(例: CompVis/stable-diffusion-v1-4)の使用を許可する
103
  - Colab または Local のノートブックを実行し、Hugging Face のトークンをノートブックに入力しログインしてノートブックを実行する。
104
- ![スクリーンショット 2022-10-05 21 33 06](https://user-images.githubusercontent.com/45703844/194061128-92b76dc0-cf2a-48c7-8930-8b3b3ab60405.png)
105
 
106
  ### File Organization / ファイル構成
107
 
108
  - stable_diffusion_cpu.ipynb
109
  - An executable file that performs image generation locally.
110
  - ローカルで画像生成を行う実行ファイル。
111
- - simulation.py
112
  - File with genetic algorithm simulations, required for both Colab and local.
113
  - 遺伝的アルゴリズムによるシミュレーションを行っているファイル。Colab、ローカルいずれの場合も必要。
114
  - sample_output_images
115
  - Folder containing the Output image described above.
116
- - 上述のOutput画像が入ったフォルダ
117
-
118
 
119
  ### Reference site / 参考サイト
120
 
121
  - [【python】遺伝的アルゴリズム(Genetic Algorithm)を実装してみる](https://mori-memo.hateblo.jp/entry/2022/06/16/232644)
122
- - [CompVis/stable-diffusionの環境をApple Siliconで構築する](https://zenn.dev/laiso/articles/7af434269ffa1b)
 
1
+ ---
2
+ title: Alien on Mars
3
+ emoji: 👽
4
+ colorFrom: pink
5
+ colorTo: blue
6
+ sdk: streamlit
7
+ sdk_version: 1.2.0
8
+ app_file: app.py
9
+ pinned: false
10
+ ---
11
+
12
  ## Space App Toyohashi in Japan / 豊橋
13
 
14
  ### [Team X Alien (チーム星人)](https://2022.spaceappschallenge.org/challenges/2022-challenges/space-biology-superhero/teams/team-x-alien/project)
 
32
 
33
  ### Output Images by Image Generation / 画像生成により出力した画像
34
 
35
+ ##### left: first Generation! Very Furry Tall Herd of No teeth Lighter skin Ferocious alien from Mars
36
+
37
+ ##### center: 500th Generation! Pair Carnivorous Gentle alien from Mars
38
+
39
+ ##### right: 1000th Generation! Pair Herbivorous Ferocious alien from Mars
40
 
41
  <div align="center">
42
  <img src="./sample_output_images/first_generation.png" alt="エビフライトライアングル" title="サンプル" style="width:240px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
49
  - Verify execution with M1 Mac, Python 3.7.13
50
 
51
  - On Colab
52
+
53
  - Open [StableDiffusionSample.ipynb on Colab](https://colab.research.google.com/drive/1Uaqmq3ibMmEwepnn4OWHf2TVboUVa14O?usp=sharing)
54
  - Upload simulation.py to the current directory of Colab
55
 
 
57
  - Install requirements.txt library in a virtual environment, etc.
58
 
59
  ### Command Example (Mac)
60
+
61
  ```
62
  # Create a virtual environment
63
  python -m venv .venv
 
72
  pip install -r requirements.txt
73
  ```
74
 
75
+ - Launch notebook StableDiffusionByCpu.ipynb.
76
 
77
  - Common
78
  - Create a [Hugging Face](https://huggingface.co/) account.
79
  - Create an access token in [Hugging Face Setting](https://huggingface.co/settings/tokens).
80
+ ![スクリーンショット 2022-10-05 21 30 00](https://user-images.githubusercontent.com/45703844/194060690-574e4ee2-be14-48f9-aa76-887ef32e737c.png)
81
  - Allow the use of the model you want to use (e.g. CompVis/stable-diffusion-v1-4), referring to the explanation on the official site.
82
  - Run a Colab or Local notebook, enter the Hugging Face token into the notebook, login and run the notebook.
83
+ ![スクリーンショット 2022-10-05 21 33 06](https://user-images.githubusercontent.com/45703844/194061128-92b76dc0-cf2a-48c7-8930-8b3b3ab60405.png)
84
 
85
+ ---
86
 
87
  - M1 Mac, Python 3.7.13 で実行を確認
88
 
89
  - グーグルコラボ
90
+
91
  - [StableDiffusionSample.ipynb on Colab](https://colab.research.google.com/drive/1Uaqmq3ibMmEwepnn4OWHf2TVboUVa14O?usp=sharing)を開く
92
  - Colab のカレントディレクトリに simulation.py をアップロードする
93
 
 
95
  - 仮想環境などに requirements.txt のライブラリをインストールする
96
 
97
  ### コマンド例(Mac)
98
+
99
  ```
100
  # 仮想環境の作成
101
  python -m venv .venv
 
110
  pip install -r requirements.txt
111
  ```
112
 
113
+ - stable_diffusion_cpu.ipynb を立ち上げる
114
 
115
  - 共通
116
  - [Hugging Face](https://huggingface.co/)のアカウントを作成する
117
  - [Hugging Face の Setting](https://huggingface.co/settings/tokens)でアクセストークンを作成する
118
+ ![スクリーンショット 2022-10-05 21 30 00](https://user-images.githubusercontent.com/45703844/194060690-574e4ee2-be14-48f9-aa76-887ef32e737c.png)
119
  - [公式サイトの解説](https://huggingface.co/docs/hub/security-tokens)を参考に、使用するモデル(例: CompVis/stable-diffusion-v1-4)の使用を許可する
120
  - Colab または Local のノートブックを実行し、Hugging Face のトークンをノートブックに入力しログインしてノートブックを実行する。
121
+ ![スクリーンショット 2022-10-05 21 33 06](https://user-images.githubusercontent.com/45703844/194061128-92b76dc0-cf2a-48c7-8930-8b3b3ab60405.png)
122
 
123
  ### File Organization / ファイル構成
124
 
125
  - stable_diffusion_cpu.ipynb
126
  - An executable file that performs image generation locally.
127
  - ローカルで画像生成を行う実行ファイル。
128
+ - simulation.py
129
  - File with genetic algorithm simulations, required for both Colab and local.
130
  - 遺伝的アルゴリズムによるシミュレーションを行っているファイル。Colab、ローカルいずれの場合も必要。
131
  - sample_output_images
132
  - Folder containing the Output image described above.
133
+ - 上述の Output 画像が入ったフォルダ
 
134
 
135
  ### Reference site / 参考サイト
136
 
137
  - [【python】遺伝的アルゴリズム(Genetic Algorithm)を実装してみる](https://mori-memo.hateblo.jp/entry/2022/06/16/232644)
138
+ - [CompVis/stable-diffusion の環境を Apple Silicon で構築する](https://zenn.dev/laiso/articles/7af434269ffa1b)
app.py CHANGED
@@ -101,7 +101,7 @@ def main():
101
  progress_bar_image.progress(0)
102
 
103
  pipe = StableDiffusionPipeline.from_pretrained(
104
- "CompVis/stable-diffusion-v1-4", use_auth_token=ACCESS_TOKEN
105
  )
106
  pipe.enable_attention_slicing()
107
 
 
101
  progress_bar_image.progress(0)
102
 
103
  pipe = StableDiffusionPipeline.from_pretrained(
104
+ "CompVis/stable-diffusion-v1-4", use_auth_token=True # ACCESS_TOKEN
105
  )
106
  pipe.enable_attention_slicing()
107