Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Stable Diffusionを動かしてみる
Search
Henry Cui
September 23, 2022
Technology
2
340
Stable Diffusionを動かしてみる
Henry Cui
September 23, 2022
Tweet
Share
More Decks by Henry Cui
See All by Henry Cui
プロダクション言語モデルの情報を盗む攻撃 / Stealing Part of a Production Language Model
zchenry
0
34
Direct Preference Optimization
zchenry
0
230
Diffusion Model with Perceptual Loss
zchenry
0
140
レンズの下のLLM / LLM under the Lens
zchenry
0
130
Go with the Prompt Flow
zchenry
0
110
Mojo Dojo
zchenry
1
160
ことのはの力で画像の異常検知 / Anomaly Detection by Language
zchenry
0
280
驚愕の事実!LangChainが抱える問題 / Problems of LangChain
zchenry
0
140
MLOps初心者がMLflowを触る / MLflow Brief Introduction
zchenry
0
70
Other Decks in Technology
See All in Technology
コミュニティサービスに「あなたへ」フィードを リリースするまでの試行錯誤
takapy
1
140
推薦システムを本番導入する上で一番優先すべきだったこと~NewsPicks記事推薦機能の改善事例を元に~
morinota
0
120
What if...? 처음부터 다시 LLM 어플리케이션을 개발한다면
huffon
0
1k
RAGのサービスをリリースして1年3ヶ月が経ちました
segavvy
4
900
20240717_イケコパ代表Copilot_in_Teams会社でこう使ってます
ponponmikankan
2
430
Git 研修 Advanced【MIXI 24新卒技術研修】
mixi_engineers
PRO
0
200
Luupの開発組織におけるインシデントマネジメントの変遷 ver.RoadtoSRENEXT2024
grimoh
1
270
シフトレフトで挑む セキュリティの生産性向上
sekido
PRO
0
270
CEL(Common Expression Language)で書いた条件にマッチしたIAM Policyを見つける / iam-policy-finder
fujiwara3
0
710
ここがすごいよ! AWS Systems Manager!
saichan11
0
1.8k
運用改善、不都合な真実 / 20240722-ssmjp-kaizen
opelab
17
8k
20240725 LLMによるDXのビジョンと、今何からやるべきか @Azure OpenAI Service Dev Day
nrryuya
3
1.1k
Featured
See All Featured
The Invisible Side of Design
smashingmag
294
50k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
228
16k
The Cost Of JavaScript in 2023
addyosmani
31
4.7k
Gamification - CAS2011
davidbonilla
78
4.9k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
19k
Git: the NoSQL Database
bkeepers
PRO
423
64k
What's new in Ruby 2.0
geeforr
338
31k
No one is an island. Learnings from fostering a developers community.
thoeni
17
2.8k
Faster Mobile Websites
deanohume
303
30k
A Philosophy of Restraint
colly
200
16k
Facilitating Awesome Meetings
lara
46
5.8k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
149
45k
Transcript
Stable Diffusionを動かしてみる 機械学習の社会実装勉強会第15回 Henry 2022/9/23
自己紹介 ▪ 東京大学理学部情報科学科 ▪ 同大学大学院情報理工学系研究科コンピュター科学専攻 ▪ 博士(情報理工学)取得 • ICMLなどの国際・国内学会・ジャーナルに論文発表 •
学振DC2・理研AIPセンター研究パートタイマー • AIPチャレンジなどの競争的研究費取得・外国大学への訪問 ▪ 在学中に大学発ベンチャーを共同創業し、CTOを務める 2
内容 ▪ 画像生成とStable Diffusionの応用例など ▪ Diffusersの使い方 ▪ デモ 3
画像生成AIモデルの発展 4
Text to Image 生成例 by Stable Diffusion 5
(Text + Image) to Image 生成例 by Stable Diffusion A
fantasy landscape, trending on artstation 6
4.2 Gigabytes, or: How to Draw Anything ▪ https://andys.page/posts/how-to-draw/ ▪
Stable Diffusionを複数回(丁寧に)使えば実現できる 7
Text Inversion や DreamBooth ▪ より高度的な作業として、ユーザー指定の概念を生成画像に 含ませる • 似た機能がどんどん公開ライブラリーに追加されていく ▪
https://birdmanikioishota.blog.fc2.com/blog-entry-8.html 8
動画生成まで実現できる ▪ https://replicate.com/andreasjansson/stable-diffusion-anim ation • 生成過程に工夫して連続な画像変換が実現される ▪ https://github.com/nateraw/stable-diffusion-videos • 潜在空間の補間という単純なアプローチ
9
日本版 Stable Diffusion ▪ https://github.com/rinnakk/japanese-stable-diffusion ▪ https://huggingface.co/spaces/rinna/japanese-stable-diffus ion で体験できる ▪
目的 • Generate Japanese-style images • Understand Japanglish • Understand Japanese unique onomatope • Understand Japanese proper noun ▪ サラリーマン 油絵 10
TrinArtなどアタク向け拡張 11
Optimized Stable Diffusion ▪ https://github.com/basujindal/stable-diffusion ▪ リソースの少ない環境でより効率的に動かせるために最適化 された実装 ▪ The
code can now generate 512x512 images using under 2.4 GB of GPU VRAM! • 魅力的ですが、後ほどのデモでは optimize されてないライブラリーで 行う 12
環境構築したくない人向け ▪ GUIまで用意してくれたパッケージ ▪ Windowsで ▪ M1/M2 Macで • https://github.com/divamgupta/diffusionbee-stable-diffusion-ui
▪ https://www.charl-e.com/ 13
より使いやすいWeb API! ▪ https://computerender.com/ ▪ 下のように叩くだけ! 14
Prompt Engineering ▪ 提示文の書き方が大事 ▪ DALEE2 https://dallery.gallery/the-dalle-2-prompt-book/ ▪ https://lexica.art/ 15
関連研究が集まるところ ▪ NeurIPS 2022 Machine Learning for Creativity and Design
Workshop ▪ https://neuripscreativityworkshop.github.io/2022/ ▪ 今年年末! 16
その他の情報源 ▪ https://github.com/awesome-stable-diffusion/awesome-sta ble-diffusion • モデル、デモ、チュートリアル、UIなど幅広い情報など ▪ Reddit • https://www.reddit.com/r/StableDiffusion
や • https://www.reddit.com/r/StableDiffusion/comments/wqaizj/list_of_ stable_diffusion_systems/ など 17
内容 ▪ 画像生成とStable Diffusionの応用例など ▪ Diffuersの使い方 ▪ デモ 18
Diffusersライブラリー ▪ https://github.com/huggingface/diffusers ▪ 公式レポジトリにあるサンプルコード • https://github.com/CompVis/stable-diffusion/tree/main/scripts ▪ Huggingface ブログ
• https://huggingface.co/blog/stable_diffusion 19
シンプルな使い方 (1/2) ▪ 環境構築 • pip install diffusers==0.2.4 transformers==4.21.2 ftfy==6.1.1
▪ インポート • from diffusers import StableDiffusionPipeline ▪ パイプラインの準備 • pipe = StableDiffusionPipeline.from_pretrained('CompVis/stable-diffusion -v1-4', use_auth_token=AUTH_TOKEN) 20
シンプルな使い方 (2/2) ▪ 推論パラメータ • inference_kwargs = dict( height=args.height, width=args.width,
guidance_scale=args.guidance_scale, num_inference_steps=args.num_inference_steps) ▪ 推論 • image = pipe(args.prompt, **inference_kwargs)['sample'][0] 21
内容 ▪ 画像生成とStable Diffusionの応用例など ▪ Diffusersの使い方 ▪ デモ 22