Skip to content

Commit b0c759d

Browse files
authored
Merge pull request #1 from Aucannot/blog/diffusers-principles-note-01
blog/diffusers-principles-note-01
2 parents 5bb5a14 + 5f7db37 commit b0c759d

9 files changed

Lines changed: 145 additions & 207 deletions

File tree

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ package-lock.json
1717

1818
# IDE configurations
1919
.idea
20-
.vscode/*
21-
!.vscode/settings.json
22-
!.vscode/extensions.json
23-
!.vscode/tasks.json
20+
.vscode/
2421

2522
# Misc
2623
_sass/vendors

.vscode/extensions.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 0 additions & 30 deletions
This file was deleted.

.vscode/tasks.json

Lines changed: 0 additions & 26 deletions
This file was deleted.

_posts/.placeholder

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: "diffusion model 大概在做什么事情?"
3+
date: 2025-11-03 17:46:00 +0800
4+
categories: ["The Principles of Diffusion Models: From Origins to Advances"]
5+
tags: [diffusion-models, reading-notes, generative-models]
6+
---
7+
8+
### 我不喜欢从原理讲起的书,但
9+
10+
我本来想直奔讲解推理加速的章节的,但看了一眼全是公式,我还是老实地从头看起吧。
11+
12+
虽然我一向不喜欢从xxx原理开始介绍的书籍
13+
14+
关于diffusion model,同事曾推荐我以下的资料:
15+
16+
- [Diffusion Models | Paper Explanation | Math Explained](http s://www.youtube.com/watch?v=HoKDTa5jHvg&t=444s)
17+
- [Flow Matching | Explanation + PyTorch Implementation](https://www.youtube.com/watch?v=7cMzfkWFWhI)
18+
19+
同事说可以直接看第二个,但都是公式推导,我连那些基本的棍子符号都忘记是什么意思了,这个视频我打开过三次,看到公示就开始涣散了,我决定放过我自己,等我足够厉害了再回来看这个广受好评的视频。
20+
21+
为了给我自己梳理一下diffusion model,我决定应该先大概建立一个感性的概念。
22+
23+
**3Blue1Brown** 一向是这方面的专家,**强烈**建议观看:[But how do AI images and videos actually work? | Guest video by Welch Labs](https://youtu.be/iv-5mZ_9CPY?si=n8vbkBPiJDRM_YHl)
24+
25+
如果上面这个视频对你来说还是有点困难,可以先从最小幅度开始建立这种感性的概念:[【闪客】为啥AI画的“表”总是10:10?]( https://www.bilibili.com/video/BV11RWizREYM/?share_source=copy_web&vd_source=4bfa9204702e7e835ea454eb5c71a71a)
26+
27+
28+
### diffusion model 大概在做什么事情?
29+
30+
我的情况比较特殊,我基本是对着diffusion model 的推理代码开始入门的,没有看过原理,所以决心开始写博客补课。
31+
32+
在diffusion model的推理过程中,除了模型权重以外,会需要输入一些参数:prompt、num_inference_steps、guidance_scale、noise_seed等等。可以先玩玩文生图的工作流:[在线ComfyUI 体验Qwen Image文生图](https://bizyair.cn/community/models/publicity/37000)
33+
34+
`3Blue1Brown`的视频中,对diffusion model的推理过程有一个很好的概括:**时变的矢量场**
35+
36+
### 参考文献
37+
38+
[1] The Principles of Diffusion Models: From Origins to Advances. arXiv preprint arXiv:2510.21890, 2025. https://arxiv.org/pdf/2510.21890

serve.sh

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
#!/bin/bash
2+
3+
# Jekyll Local Development Server Script
4+
# This script sets up and runs the Jekyll site locally for development
5+
6+
set -e # Exit on any error
7+
8+
# Color codes for output formatting
9+
RED='\033[0;31m'
10+
GREEN='\033[0;32m'
11+
YELLOW='\033[1;33m'
12+
BLUE='\033[0;34m'
13+
NC='\033[0m' # No Color
14+
15+
# Function to print colored output
16+
print_info() {
17+
echo -e "${BLUE}[INFO]${NC} $1"
18+
}
19+
20+
print_success() {
21+
echo -e "${GREEN}[SUCCESS]${NC} $1"
22+
}
23+
24+
print_warning() {
25+
echo -e "${YELLOW}[WARNING]${NC} $1"
26+
}
27+
28+
print_error() {
29+
echo -e "${RED}[ERROR]${NC} $1"
30+
}
31+
32+
# Check if bundle command is available
33+
check_bundle() {
34+
if ! command -v bundle &> /dev/null; then
35+
print_error "bundle command not found!"
36+
print_info "Please install Ruby and Bundler:"
37+
print_info " - Install Ruby: https://www.ruby-lang.org/en/documentation/installation/"
38+
print_info " - Install Bundler: gem install bundler"
39+
exit 1
40+
fi
41+
print_success "Bundler is installed"
42+
}
43+
44+
# Check if Gemfile exists
45+
check_gemfile() {
46+
if [ ! -f "Gemfile" ]; then
47+
print_error "Gemfile not found in current directory!"
48+
print_info "Please run this script from the Jekyll project root"
49+
exit 1
50+
fi
51+
print_success "Gemfile found"
52+
}
53+
54+
# Install dependencies
55+
install_dependencies() {
56+
print_info "Installing dependencies..."
57+
bundle install
58+
print_success "Dependencies installed successfully"
59+
}
60+
61+
# Clean previous builds (optional)
62+
clean_build() {
63+
read -p "Do you want to clean previous builds? (y/n): " -n 1 -r
64+
echo
65+
if [[ $REPLY =~ ^[Yy]$ ]]; then
66+
print_info "Cleaning previous builds..."
67+
rm -rf _site
68+
rm -rf .jekyll-cache
69+
print_success "Build directory cleaned"
70+
fi
71+
}
72+
73+
# Start Jekyll development server
74+
start_server() {
75+
print_info "Starting Jekyll development server..."
76+
print_info "Server will be available at: http://localhost:4000"
77+
print_info "Press Ctrl+C to stop the server"
78+
echo
79+
80+
# Start Jekyll with live reload
81+
bundle exec jekyll serve --watch --livereload
82+
}
83+
84+
# Main execution
85+
main() {
86+
echo "========================================="
87+
echo " Jekyll Local Development Server"
88+
echo "========================================="
89+
echo
90+
91+
# Run checks and setup
92+
check_bundle
93+
check_gemfile
94+
install_dependencies
95+
clean_build
96+
97+
echo
98+
print_info "Starting server..."
99+
echo
100+
101+
# Start the server
102+
start_server
103+
}
104+
105+
# Run main function
106+
main

tools/run.sh

Lines changed: 0 additions & 54 deletions
This file was deleted.

tools/test.sh

Lines changed: 0 additions & 89 deletions
This file was deleted.

0 commit comments

Comments
 (0)