---
title: Stable Diffusionの仕組み（入門編）
description: Stable Diffusionの仕組みや画像生成AIの歴史について解説。CLIPやUNETの活用方法も紹介。画像生成技術の変遷を知りたい方必見。
image: https://ja.aicu.ai/wp-content/uploads/2024/06/image-37.png
---

[![AICU-LogoWT](https://corp.aicu.ai/hs-fs/hubfs/Logo/AICU-LogoWT.png?width=200&height=512&name=AICU-LogoWT.png "AICU-LogoWT")](https://aicu.ai)

Search toggle

- [AICU](https://aicu.ai/)
  
  AICU

    - [Blog \[English\]](https://corp.aicu.ai/en)
    - [Blog \[Japanese\]](https://corp.aicu.ai/ja/)
    - [note](https://note.com/aicu)
    - [medium](https://medium.com/@aicu)
- [Products](https://corp.aicu.ai/ja/products)
  
  Products

    - [AICU media](https://note.com/aicu/)
    - [X(Twitter)@AICUai](https://twitter.com/AICUai)
    - [日本市場向け製品](https://corp.aicu.ai/ja/products)
      
      日本市場向け製品

          - [特定商取引法](https://corp.aicu.ai/jp-commercial-transactions-act)
    - [AI market dev solutions](https://corp.aicu.ai/products)
    - [LINE Chatbot \[LuC4\] 全力肯定彼氏くん](https://corp.aicu.ai/ja/tag/luc4%E5%85%A8%E5%8A%9B%E8%82%AF%E5%AE%9A%E5%BD%BC%E6%B0%8F%E3%81%8F%E3%82%93)
    - [AICuty](https://corp.aicu.ai/aicuty)
    - [Lecture](https://bit.ly/AICUCEO)
    - [AICU Creator Union Membership](https://note.com/aicu/membership/info)
    - [Pricing](https://corp.aicu.ai/ja/pricing)
- [AICU Japan](https://aicu.jp/)
- [About Us](https://corp.aicu.ai/about)
  
  About Us

    - [Vision](https://corp.aicu.ai/vision)
    - [Privacy Policy](https://corp.aicu.ai/ja/privacy)
    - [Media Policy](https://corp.aicu.ai/media-policy)
    - [PRTIMES](https://prtimes.jp/main/html/searchrlp/company_id/133647)
    - [Become a partner](https://j.aicu.ai/Creg)
    - [Contact](https://corp.aicu.ai/contact)

[Follow us on Facebook](https://m.me/118997804638852?ref=klE9gy8WjnrE) [Follow us on Twitter](https://www.youtube.com/@AICuty) [Follow us on Instagram](https://twitter.com/AICUai)

[![AICU-LogoWT](https://corp.aicu.ai/hs-fs/hubfs/Logo/AICU-LogoWT.png?width=200&height=512&name=AICU-LogoWT.png "AICU-LogoWT")](https://aicu.ai)

- [AICU](https://aicu.ai/)
  
  AICU

    - [Blog \[English\]](https://corp.aicu.ai/en)
    - [Blog \[Japanese\]](https://corp.aicu.ai/ja/)
    - [note](https://note.com/aicu)
    - [medium](https://medium.com/@aicu)
- [Products](https://corp.aicu.ai/ja/products)
  
  Products

    - [AICU media](https://note.com/aicu/)
    - [X(Twitter)@AICUai](https://twitter.com/AICUai)
    - [日本市場向け製品](https://corp.aicu.ai/ja/products)
      
      日本市場向け製品

          - [特定商取引法](https://corp.aicu.ai/jp-commercial-transactions-act)
    - [AI market dev solutions](https://corp.aicu.ai/products)
    - [LINE Chatbot \[LuC4\] 全力肯定彼氏くん](https://corp.aicu.ai/ja/tag/luc4%E5%85%A8%E5%8A%9B%E8%82%AF%E5%AE%9A%E5%BD%BC%E6%B0%8F%E3%81%8F%E3%82%93)
    - [AICuty](https://corp.aicu.ai/aicuty)
    - [Lecture](https://bit.ly/AICUCEO)
    - [AICU Creator Union Membership](https://note.com/aicu/membership/info)
    - [Pricing](https://corp.aicu.ai/ja/pricing)
- [AICU Japan](https://aicu.jp/)
- [About Us](https://corp.aicu.ai/about)
  
  About Us

    - [Vision](https://corp.aicu.ai/vision)
    - [Privacy Policy](https://corp.aicu.ai/ja/privacy)
    - [Media Policy](https://corp.aicu.ai/media-policy)
    - [PRTIMES](https://prtimes.jp/main/html/searchrlp/company_id/133647)
    - [Become a partner](https://j.aicu.ai/Creg)
    - [Contact](https://corp.aicu.ai/contact)

Search toggle

[![AICU-LogoWT](https://corp.aicu.ai/hs-fs/hubfs/Logo/AICU-LogoWT.png?width=200&height=512&name=AICU-LogoWT.png "AICU-LogoWT")](https://aicu.ai)

- [AICU](https://aicu.ai/)
  
  AICU

    - [Blog \[English\]](https://corp.aicu.ai/en)
    - [Blog \[Japanese\]](https://corp.aicu.ai/ja/)
    - [note](https://note.com/aicu)
    - [medium](https://medium.com/@aicu)
- [Products](https://corp.aicu.ai/ja/products)
  
  Products

    - [AICU media](https://note.com/aicu/)
    - [X(Twitter)@AICUai](https://twitter.com/AICUai)
    - [日本市場向け製品](https://corp.aicu.ai/ja/products)
      
      日本市場向け製品

          - [特定商取引法](https://corp.aicu.ai/jp-commercial-transactions-act)
    - [AI market dev solutions](https://corp.aicu.ai/products)
    - [LINE Chatbot \[LuC4\] 全力肯定彼氏くん](https://corp.aicu.ai/ja/tag/luc4%E5%85%A8%E5%8A%9B%E8%82%AF%E5%AE%9A%E5%BD%BC%E6%B0%8F%E3%81%8F%E3%82%93)
    - [AICuty](https://corp.aicu.ai/aicuty)
    - [Lecture](https://bit.ly/AICUCEO)
    - [AICU Creator Union Membership](https://note.com/aicu/membership/info)
    - [Pricing](https://corp.aicu.ai/ja/pricing)
- [AICU Japan](https://aicu.jp/)
- [About Us](https://corp.aicu.ai/about)
  
  About Us

    - [Vision](https://corp.aicu.ai/vision)
    - [Privacy Policy](https://corp.aicu.ai/ja/privacy)
    - [Media Policy](https://corp.aicu.ai/media-policy)
    - [PRTIMES](https://prtimes.jp/main/html/searchrlp/company_id/133647)
    - [Become a partner](https://j.aicu.ai/Creg)
    - [Contact](https://corp.aicu.ai/contact)

[Follow us on Facebook](https://m.me/118997804638852?ref=klE9gy8WjnrE) [Follow us on Twitter](https://www.youtube.com/@AICuty) [Follow us on Instagram](https://twitter.com/AICUai)

Search toggle

What are you looking for?

Search

# Stable Diffusionの仕組み（入門編）

 2024/6月/3

![Picture of AICU Japan](https://corp.aicu.ai/hs-fs/hubfs/2023-09-20_062230-3.png?width=40&name=2023-09-20_062230-3.png) [AICU Japan](https://corp.aicu.ai/ja/author/aidx-lab)

![Stable Diffusionの仕組み（入門編）](https://ja.aicu.ai/wp-content/uploads/2024/06/image-37.png)

Stable Diffusionの仕組みについてご存知ですか？  
プロンプトを入れると画像が生成される…その内部を説明できるとかっこいいですよね。  
こちらの講演で使用したスライドを白井CEOから頂いたので一部公開いたします。

[https://note.com/aicu/n/n8d4575bcf026](https://note.com/aicu/n/n8d4575bcf026)<https://note.com/aicu/n/n8d4575bcf026?source=post_page-----6e2834e325ef-------------------------------->

画像生成AIの誕生と変遷(2)画像生成技術の歴史年表

[https://note.com/o\_ob/n/n971483495ef3](https://note.com/o_ob/n/n971483495ef3)<https://note.com/o_ob/n/n971483495ef3?source=post_page-----6e2834e325ef-------------------------------->

画像生成AIの誕生と変遷(4) 画像生成AIの2014–2024におきたパラダイムシフト

[https://note.com/o\_ob/n/n3c1d8523cf68](https://note.com/o_ob/n/n3c1d8523cf68)<https://note.com/o_ob/n/n3c1d8523cf68?source=post_page-----6e2834e325ef-------------------------------->

![](https://ja.aicu.ai/wp-content/uploads/2024/06/image-32.png)

![](https://ja.aicu.ai/wp-content/uploads/2024/06/image-33.png)

# Stable Diffusionの仕組み（入門編）

![](https://ja.aicu.ai/wp-content/uploads/2024/06/image-36.png)

[![ComfyUI 知らないの？](https://no-cache.hubspot.com/cta/default/43845236/interactive-185006873759.png)](https://corp.aicu.ai/hs/cta/wi/redirect?encryptedPayload=AVxigLLDTbwg5yBxFkPWPinxfSpfkA0l4f2OBL3uH3kkwYWTnxWHJd0evS04lhNJjEPGynGyOaPottJVrXmgXoOWI30l2OLe3JGVsQgXbwXIGHqW1De8JctVVDMRBETmwK%2BdniPt%2B7LLuvrUlkZVqepAoL79ft6LLOWuDfJI5fSqlNddCJtUznj3fTWp1fmKti%2BSyw%3D%3D&webInteractiveContentId=185006873759&portalId=43845236&hsLang=ja)

[![画像生成 お困りですか？](https://no-cache.hubspot.com/cta/default/43845236/interactive-185263496576.png)](https://corp.aicu.ai/hs/cta/wi/redirect?encryptedPayload=AVxigLJi3xmfDCwjz85VZUMCn8X1rMMwCv%2Fl9doCYKrFqO9oWOvHdfIA5E2sLTf6uWXln3g3A7pcHPnIpigya9lZxlar0MVZhxAayN5rI9FZp7DtouTRC7S3lf7WGNBHItvPk5beobCEzg%2F%2BlJ8YNGgPOxVkY5uiez44qEVNwS4CUTWKWzvB%2FDpmRGyupnF9BbtZVg%3D%3D&webInteractiveContentId=185263496576&portalId=43845236&hsLang=ja)

CLIPとは画像とテキストの関係だけを学んでいます。  
CLIP (Contrastive Language-Image Pretraining), Predict the most relevant text snippet given an image

[https://github.com/openai/CLIP](https://github.com/openai/CLIP)<https://github.com/openai/CLIP?source=post_page-----6e2834e325ef-------------------------------->

実はネガティブプロンプトはStable Diffusionが公開されてからAUTOMATIC111で生まれました。

[https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Negative-prompt](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Negative-prompt)<https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Negative-prompt?source=post_page-----6e2834e325ef-------------------------------->

![](https://ja.aicu.ai/wp-content/uploads/2024/06/image-38.png)

ネガティブプロンプトは、正プロンプトと同じ仕組みでCLIPを持ち、サンプラーが条件付き逆拡散をする際にUNETの左側に入ります。  
画像のLatent Space化はちょうどZIP圧縮のような超圧縮で、フロート列が並んでいるweight&biasです。VAEを使うことで画像に展開できます。

![](https://ja.aicu.ai/wp-content/uploads/2024/06/image-34.png)

ImageToImageやControlNetも、基本的にはLatent SpaceでUNETの左側に入ります。

UNetについて補足

![](https://ja.aicu.ai/wp-content/uploads/2024/06/image-35.png)

UNETは元々は医用画像のセグメンテーションタスクのために想定されたが、多くの画像2-画像タスクに再利用されている。畳み込みエンコーダ（ダウンサンプリング）とデコーダ（アップサンプリング）を持つ。

マルチスケール、マルチ抽象レベルで変調を学習。

ReLU(Rectified Linear Unit)のことで、max(0, x)のような実装をする。Convolution層ではこの活性化関数を使うことが多い。

[https://deepage.net/deep\_learning/2016/11/07/convolutional\_neural\_network.html](https://deepage.net/deep_learning/2016/11/07/convolutional_neural_network.html)

[https://lmb.informatik.uni-freiburg.de/people/ronneber/u-net/](https://lmb.informatik.uni-freiburg.de/people/ronneber/u-net/)<https://deepage.net/deep_learning/2016/11/07/convolutional_neural_network.html?source=post_page-----6e2834e325ef-------------------------------->

画像生成AI Stable Diffusion スタートガイドより。

[https://j.aicu.ai/SBXL](https://j.aicu.ai/SBXL)

[https://j.aicu.ai/SBXL](https://j.aicu.ai/SBXL)

[![最新情報はメールニュース  ](https://no-cache.hubspot.com/cta/default/43845236/interactive-185006873894.png)](https://corp.aicu.ai/hs/cta/wi/redirect?encryptedPayload=AVxigLLCXY5Jtl41E%2BH5TJVNJgo%2FSBI4orWqb4cegUq%2FMFJbOpdWku7ng0Wb%2B3G9Ozc%2BqTk7mJf%2BqdIixHAj1JAph2dBhMO9FZY84nQpGB58LmL4x3bhunMvzIGiX3DtQqoKrKM1TMC0ufHpJXd0F3m6YbO0vxbmys93ZeisjSY7%2By%2FvmID%2BYVwl7sUx7dg%3D&webInteractiveContentId=185006873894&portalId=43845236&hsLang=ja)

*Originally published at* [*https://note.com*](https://note.com/aicu/n/n505b0dfb1a75) *on May 30, 2024.*

### Share:

[Share on Facebook](http://www.facebook.com/share.php?u=https://corp.aicu.ai/ja/sd20240530&utm_medium=social&utm_source=facebook) [Share on LinkedIn](http://www.linkedin.com/shareArticle?mini=true&url=https://corp.aicu.ai/ja/sd20240530&utm_medium=social&utm_source=linkedin) [Share on X](https://twitter.com/intent/tweet?original_referer=https://corp.aicu.ai/ja/sd20240530&utm_medium=social&utm_source=twitter&url=https://corp.aicu.ai/ja/sd20240530&utm_medium=social&utm_source=twitter&source=tweetbutton&text=Stable%20Diffusionの仕組み（入門編）)

[AI](https://corp.aicu.ai/ja/tag/ai), [画像生成](https://corp.aicu.ai/ja/tag/画像生成), [CLIP](https://corp.aicu.ai/ja/tag/clip), [過去記事アーカイブ](https://corp.aicu.ai/ja/tag/過去記事アーカイブ)

## AICU Japan

AICU Inc. AIDX Lab - Koto

[info@aicu.ai](mailto:info@aicu.ai)

## Comments

## Related posts

Search [AICU media 学生インターン募集(2023年11月期)](https://corp.aicu.ai/ja/intern20231103?hsLang=ja)

[\[速報\]AICU CEO白井が「ChatGPTとStable Diffusion丸わかりナイト」に登壇いたしました](https://corp.aicu.ai/ja/talk20240530?hsLang=ja) Search

![AICU-LogoWT](https://corp.aicu.ai/hs-fs/hubfs/Logo/AICU-LogoWT.png?width=210&name=AICU-LogoWT.png "AICU-LogoWT")

AICU Inc. is AIDX company.

[Follow us on Facebook](https://m.me/118997804638852?ref=klE9gy8WjnrE) [Follow us on Twitter](https://twitter.com/AICUai) [Follow us on Instagram](https://www.youtube.com/@AICuty)

Main Office: 830 STWART DR STE277 SUNNYVALE, CA 94085-4513

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "AICU Japan",
    "url" : "https://corp.aicu.ai/ja/author/aidx-lab"
  },
  "dateModified" : "2025-03-07T23:58:01.693Z",
  "datePublished" : "2024-06-03T18:32:34.000Z",
  "headline" : "Stable Diffusionの仕組み（入門編）",
  "image" : [ "https://ja.aicu.ai/wp-content/uploads/2024/06/image-37.png" ],
  "mainEntityOfPage" : {
    "@id" : "https://corp.aicu.ai/ja/sd20240530",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://corp.aicu.ai/hubfs/android-chrome-512x512.png"
    },
    "name" : "AICU Inc."
  }
}
```