← Archive
lm-003070 · 2026-08

視覺生成作為約束域求解

下載 MD 檔 ⬇

視覺生成作為約束域求解

從人類意圖到高維圖像空間導航

英文題名: Visual Generation as Constraint-Domain Solving: From Human Intent to Navigation in High-Dimensional Image Space
作者: Neo.K / EveMissLab
版本: v0.1-draft
日期: 2026-08-12
系列: Global Visual Space & Generative Navigation — Paper 02
前篇:《全域視覺空間假說:從量化灰階方塊到高維圖像狀態空間》
文件性質: 理論論文/生成模型、條件控制、約束求解與視覺空間研究

關鍵詞: 約束域、視覺導航、生成模型、人類意圖、條件生成、擴散模型、Guidance、Constraint Satisfaction、Energy-Based Guidance、ControlNet、LoRA、Reference、Style Kernel、AI Art Direction


摘要

前篇《全域視覺空間假說》建立了一個最底層的形式地基:對固定有限數位 raster specification Σ\Sigma,所有可表示圖像形成有限高維離散空間 ΩΣ\Omega_\Sigma,而每一張具體圖像都只是其中的一個精確狀態點。

然而,這個結果立即產生下一個問題:若完整圖像空間極端巨大,人類與生成模型如何從中得到「想要的那一張」?

本文提出「視覺生成作為約束域求解」(Visual Generation as Constraint-Domain Solving, VGCDS)框架。核心命題是:生成式 AI 的重要功能不只是從噪聲映射到圖像,而是將人類意圖、語意、主體、風格、構圖、參考圖、結構條件、專案規則與偏好,轉換成一組作用於視覺狀態空間或生成模型可達域上的約束,並在這些約束共同定義的有效域中搜尋、優化或採樣。

最簡形式為:

Ω=i=1mΩi,\Omega^\star = \bigcap_{i=1}^{m} \Omega_i,

其中 Ωi\Omega_i 是第 ii 個條件所允許的視覺子域。

但實際生成中的條件並不都是硬集合約束。Prompt、Style、Reference、LoRA、ControlNet、色彩偏好與專案審美常具有模糊性、權重性與相互衝突。因此本文進一步將約束分為:

  1. Hard Constraint:不滿足即不可接受;
  2. Soft Constraint:允許違反,但有代價;
  3. Preference / Energy Constraint:定義相對偏好,不直接切除空間;
  4. Probabilistic Condition:以條件概率重加權生成分佈;
  5. Structural Operator Constraint:透過 LoRA、Adapter、ControlNet 等直接改變模型可達域或採樣動力學。

由此,視覺求解可以寫為:

I=argminIΩG[jλjEj(I)]I^\star = \arg\min_{I\in\Omega_G} \left[ \sum_j \lambda_j E_j(I) \right]

受限於:

Ck(I)=1,kH,C_k(I)=1,\qquad k\in\mathcal H,

或以概率形式寫成:

p(I)pG(I)jψj(I)λj,p^\star(I) \propto p_G(I) \prod_j \psi_j(I)^{\lambda_j},

其中 pGp_G 是生成模型先驗, ψj\psi_j 是不同條件/評價/能量因子。

本文主張:

Generation=Navigation / Search / Sampling under Constraints\boxed{ \text{Generation} = \text{Navigation / Search / Sampling under Constraints} }

而:

PromptComplete Visual Coordinate\boxed{ \text{Prompt} \neq \text{Complete Visual Coordinate} }

Prompt 更像低帶寬、模糊、概率性的導航條件;Reference、LoRA、ControlNet、Style Kernel、Project Recipe、Seed、Sampler 與 Agentic Workflow 共同決定實際可達域與搜索路徑。

本文同時提出「Intent Compiler」概念:真正的 AI 美術代理不應把使用者變成底層生成軟體操作員,而應將高階意圖編譯成多重約束、Provider、權重與工作流:

IntentConstraintProgramSearchPolicyI.Intent \rightarrow ConstraintProgram \rightarrow SearchPolicy \rightarrow I^\star.

這將「Prompt Engineering」提升為更廣義的「Constraint Engineering」,並為 AI Art Direction、AADS、Generative Asset Registry 與 PCFT / Hemilattice 提供共同理論接口。


1. 引言:知道所有圖在哪裡之後

前篇建立:

IΩΣ.I\in\Omega_\Sigma.

問題是:

ΩΣ|\Omega_\Sigma|

極端巨大。

100×100100\times100 、8-bit 灰階為例:

Ω=280000.|\Omega| = 2^{80000}.

在這樣的空間中,知道「目標圖理論上存在」幾乎沒有直接工程價值。

真正的問題變成:

如何不暴力枚舉整個 ΩΣ\Omega_\Sigma,而快速到達符合人類意圖的區域?


2. 從「生成」到「求解」

2.1 傳統簡寫

生成模型常簡寫為:

I=Gθ(z,c),I=G_\theta(z,c),

其中:

  • zz:latent / noise / seed-derived state;
  • cc:conditioning;
  • θ\theta:模型參數。

這個表示描述了函數結構,但容易讓人以為:

條件 cc 已經完整指定了人類意圖。

實際上並非如此。


3. 人類意圖不是像素地址

假設使用者說:

「我要一個冷峻但不是網紅臉的武俠女劍客,雨夜,舊城屋簷,整體要有專案自己的畫風。」

這句話沒有直接給出:

Ψ(I).\Psi(I^\star).

它也沒有給出 100 萬個以上 pixel values。

它提供的是一組高階語意與審美條件。

因此應表示為:

Intent=Ih,Intent = \mathcal I_h,

再由某個編譯過程轉成:

C=Compile(Ih).\mathcal C = Compile(\mathcal I_h).

4. 約束域

對任一條件 CiC_i,定義其允許域:

Ωi={IΩ:Ci(I)=1}.\Omega_i = \{I\in\Omega: C_i(I)=1\}.

例如:

4.1 語意域

Ωwoman\Omega_{\text{woman}}

包含被判定為女性角色的圖像。

4.2 服裝域

Ωwuxia-costume.\Omega_{\text{wuxia-costume}}.

4.3 場景域

Ωrain-night-town.\Omega_{\text{rain-night-town}}.

4.4 風格域

Ωproject-style.\Omega_{\text{project-style}}.

5. 硬交集模型

理想情況:

Ω=Ω1Ω2Ωm.\Omega^\star = \Omega_1 \cap \Omega_2 \cap \dots \cap \Omega_m.

若:

Ω,\Omega^\star\neq\varnothing,

任意:

IΩI^\star\in\Omega^\star

皆滿足所有硬條件。


6. 但人類美術要求很少是真正二元

例如:

「比較有江湖感。」

不是:

0/1.0/1.

而更像:

sjianghu(I)[0,1].s_{\text{jianghu}}(I)\in[0,1].

所以純集合交集不足。


7. Soft Constraint

定義違反代價:

Ei(I)0.E_i(I)\geq0.

若完全滿足:

Ei(I)=0.E_i(I)=0.

越偏離要求:

Ei(I).E_i(I)\uparrow.

例如:

Estyle=dK(K(I),K).E_{\text{style}} = d_K(K(I),K^\star).

8. 帶權約束目標

最簡:

I=argminIi=1mλiEi(I).I^\star = \arg\min_{I} \sum_{i=1}^{m} \lambda_i E_i(I).

其中:

λi0\lambda_i\geq0

表示條件重要程度。


9. Hard + Soft 混合

將硬約束集合記為:

H.\mathcal H.

則:

I=argminIjSλjEj(I)I^\star = \arg\min_I \sum_{j\in\mathcal S} \lambda_jE_j(I)

subject to:

Ci(I)=1,iH.C_i(I)=1, \quad i\in\mathcal H.

10. 例子:角色生成

Hard:

不能有兩個頭
角色必須完整出現在畫面
不可出現文字浮水印
指定角色身份不可錯

Soft:

江湖感
陰鬱程度
服裝傳統度
畫面華麗度
臉部獨特性

11. 約束交集可能為空

若:

iΩi=,\bigcap_i\Omega_i=\varnothing,

則要求本身不可同時完全滿足。

例如:

完全寫實照片
+
完全像素畫
+
每個像素只能 4 色
+
皮膚必須有真實毛孔

若全部被設成硬約束,可能形成矛盾。


12. 最小違反問題

此時求:

I=argminIiλiEi(I).I^\star = \arg\min_I \sum_i \lambda_iE_i(I).

也就是:

找到總違反最小的候選。


13. AI Art Director 的第一個價值:仲裁矛盾

人類不需要自己知道:

LoRA A 和 Style B 衝突
Reference C 對構圖限制太強
ControlNet Pose 與服裝 silhouette 不相容

Agent 可以估計:

Conflict(Ci,Cj).Conflict(C_i,C_j).

14. Constraint Conflict Graph

建立:

GC=(VC,EC).G_C=(V_C,E_C).

Node:

VC={C1,,Cm}.V_C=\{C_1,\dots,C_m\}.

若:

Conflict(Ci,Cj)>τ,Conflict(C_i,C_j)>\tau,

加入 Conflict Edge。


15. 約束不是都作用於 raster space

這一點非常重要。

有些條件直接判斷輸出圖:

OCR
顏色
物件
構圖

但 LoRA 改變模型參數:

θθ+Δθ.\theta \rightarrow \theta+\Delta\theta.

ControlNet 改變生成網路中的條件訊號。

Sampler 改變搜索路徑。

因此完整約束系統必須作用於多個空間。


16. 四層約束空間

本文區分:

16.1 Output Constraint

作用於:

I.I.

16.2 Latent Constraint

作用於:

zt.z_t.

16.3 Model Constraint

作用於:

θ.\theta.

16.4 Process Constraint

作用於:

π,\pi,

即生成工作流/採樣政策。


17. 完整生成狀態

因此一個生成狀態不只是一張圖:

S=(I,z,θ,π,c).S = (I,z,\theta,\pi,c).

約束可以作用於:

Ci(S).C_i(S).

18. LoRA 的約束位置

LoRA:

θ=θ+Δθ.\theta' = \theta+\Delta\theta.

所以 LoRA 本質上是:

改變生成向量場/概率分佈,而不是生成後再檢查一張圖。


19. ControlNet 的約束位置

ControlNet 類空間條件:

edge
pose
depth
segmentation

直接注入生成網路。

這說明:

Prompt 對複雜 layout、pose、shape 的控制不足時,額外空間條件能提供更細粒度的限制。


20. 現代可控生成的直接證據

ControlNet 的原始研究明確指出:

純文字很難精確表達複雜構圖、姿勢、形狀與空間形式。

因此:

TextCondition⊅AllVisualConstraints\boxed{ TextCondition \not\supset AllVisualConstraints }

不是純哲學推論,而有直接工程證據。


21. Probability Reweighting

另一種看法是:

生成模型定義先驗:

pG(I).p_G(I).

條件 CC 定義 compatibility:

p(CI).p(C\mid I).

則:

p(IC)pG(I)p(CI).p(I\mid C) \propto p_G(I)p(C\mid I).

22. Classifier-Free Guidance 的空間詮釋

Classifier-Free Guidance 透過 conditional / unconditional score 的組合,在 sample fidelity 與 diversity 之間建立 guidance trade-off。

從本文角度:

Guidance scale 就是在修改條件域附近的概率密度。

因此:

Guidancenew image space.Guidance \neq \text{new image space}.

它是:

reweighting / redirecting search.\text{reweighting / redirecting search}.

23. Guidance Scale 不是「越大越好」

條件權重提高可能:

prompt adherence ↑
diversity ↓
artifact ↑
style rigidity ↑

因此:

λ\lambda\rightarrow\infty

不一定最佳。


24. 條件權重就是域壓縮強度

若:

λi,\lambda_i\uparrow,

採樣更集中於滿足 CiC_i 的區域。

直觀上:

Volume(Ωeffective).Volume(\Omega_{\text{effective}}) \downarrow.

但這裡的 Volume 是概率質量/有效可達域的概念,不必等同普通 Euclidean volume。


25. Energy-Based 形式

定義每個約束:

Ei(I).E_i(I).

則:

p(I)pG(I)exp(iλiEi(I)).p^\star(I) \propto p_G(I) \exp \left( -\sum_i\lambda_iE_i(I) \right).

26. Composable Diffusion 的直接對應

Composable Diffusion 將不同 diffusion model 視為 energy-based model,並組合不同 component 的能量分佈以完成更複雜條件組合。

這與本文:

iψi(I)\prod_i\psi_i(I)

的多約束乘積形式直接一致。


27. AND 條件

若:

woman
AND
sword
AND
rain

則近似:

p(IC1C2C3)pG(I)iψi(I).p(I\mid C_1\land C_2\land C_3) \propto p_G(I) \prod_i\psi_i(I).

28. NOT 條件

例如:

not generic AI face

可以建立:

Egeneric-face(I)E_{\text{generic-face}}(I)

並提高其懲罰。


29. 約束因此是一種能量塑形

原始 landscape:

EG(I).E_G(I).

加入要求後:

E(I)=EG(I)+iλiEi(I).E^\star(I) = E_G(I) + \sum_i\lambda_iE_i(I).

生成:

在被重新塑形的能量景觀中採樣。


30. Universal Guidance

Universal Guidance 類方法顯示,可以透過 sampling-time guidance,利用:

segmentation
face recognition
object detection
classifier

等不同外部 guidance function 控制 diffusion,而不必為每一種條件重新訓練專門模型。

這支持本文的:

Constraintmust be baked into base model\boxed{ Constraint \neq \text{must be baked into base model} }

31. Constraint Provider

因此一個約束可以由不同 Provider 實作。

例如:

Cface-id.C_{\text{face-id}}.

Provider:

face embedding
IP-Adapter
DreamBooth
LoRA
identity classifier guidance

32. Operator 與 Provider 再次分離

ConstraintOperatorConstraintProvider\boxed{ ConstraintOperator \neq ConstraintProvider }

這與前面 PCFT / AADS 的:

OperatorProviderOperator\neq Provider

完全一致。


33. 人類意圖是 underspecified 的

一句:

「畫一個漂亮的女人。」

對應:

ΩC1.|\Omega_C|\gg1.

甚至巨大。

所以生成模型有自由度。


34. 多樣性來自剩餘自由度

若所有約束沒有唯一決定 II

ΩC>1.|\Omega_C|>1.

則模型可以在:

ΩC\Omega_C

中採樣多個候選。


35. 創造性可以形式化為剩餘解域

一個非常重要的觀點:

約束不是越多越好。

如果:

ΩC\Omega_C

被壓縮到過小:

結果僵化
每張太像
創造性下降

36. 風格一致性–多樣性張力

專案要求:

KcτKK_c\geq\tau_K

但同時希望:

DvτD.D_v\geq\tau_D.

所以:

maxDv\max D_v

subject to:

KcτK.K_c\geq\tau_K.

這比:

把 Style LoRA 權重一直調高

更合理。


37. 約束域不是越小越好

最理想的是:

Ωvalid\Omega_{\text{valid}}

足夠小以保證:

風格
角色
世界觀

又足夠大以允許:

構圖
姿勢
表情
局部設計

多樣化。


38. Constraint Capacity

可以定義剩餘自由度:

RC=H(IC).R_C = H(I\mid\mathcal C).

直觀:

  • RCR_C 太高 → 控制不足;
  • RCR_C 太低 → 過度約束;
  • 中間區域 → 可控創造。

39. Prompt 的角色重新定義

Prompt 不是:

圖像絕對座標。

而是:

p(I)p(Ip).p(I) \rightarrow p(I\mid p).

即:

概率分佈重加權器。


40. Reference 的角色

Reference:

p(Ip)p(Ip,R).p(I\mid p) \rightarrow p(I\mid p,R).

通常比文字提供更高頻的視覺條件。


41. LoRA 的角色

LoRA 改變:

pθ(Ic)pθ+Δθ(Ic).p_{\theta}(I\mid c) \rightarrow p_{\theta+\Delta\theta}(I\mid c).

也就是改變模型可達域與概率景觀。


42. Seed 的角色

Seed 選定:

z0.z_0.

它影響某一條採樣軌跡。

所以:

Seed=trajectory initializationSeed = \text{trajectory initialization}

而不是:

global image coordinate.\text{global image coordinate}.

43. Sampler 的角色

Sampler / Scheduler 定義:

π.\pi.

因此相同:

model
prompt
seed

若:

π1π2,\pi_1\neq\pi_2,

結果也可能不同。


44. 完整生成地址

若要描述一張生成圖的 reproducible generation state,更接近:

Agen=(θ,Δθ,c,R,Cstruct,z0,π,h),A_{\text{gen}} = ( \theta, \Delta\theta, c, R, C_{\text{struct}}, z_0, \pi, h ),

其中 hh 是軟體/版本等執行狀態。


45. Generation Address 與 Raster Address

兩者不同:

AgenΨ(I).A_{\text{gen}} \neq \Psi(I).

前者描述:

怎麼到達。

後者描述:

到達哪個 raster state。


46. 多條路徑可以到同一張圖

可能:

A1A2A_1\neq A_2

但:

Decode(A1)=Decode(A2)=I.Decode(A_1)=Decode(A_2)=I.

因此:

PathState\boxed{ \text{Path} \neq \text{State} }

47. 生成模型的可達域

定義:

ΩG={Gθ,π(z,c):z,c,πA}.\Omega_G = \{ G_{\theta,\pi}(z,c): z,c,\pi\in\mathcal A \}.

顯然:

ΩGΩΣ.\Omega_G \subseteq \Omega_\Sigma.

48. 條件可達域

對約束 C\mathcal C

ΩG(C)ΩG.\Omega_G(\mathcal C) \subseteq \Omega_G.

49. AI 的工作不是遍歷 ΩΣ\Omega_\Sigma

而是:

Sample(ΩG(C)).Sample( \Omega_G(\mathcal C) ).

這是比暴力枚舉小非常多的有效問題。


50. 模型本身是巨大的搜索壓縮器

模型參數:

θ\theta

把大量視覺規律壓縮在一個生成函數中。

因此它能:

跳過幾乎全部高熵無意義 raster states。


51. 這與自然圖像流形一致

可以寫:

ΩGMGΩΣ.\Omega_G \approx \mathcal M_G \subset \Omega_\Sigma.

模型主要在結構化視覺子域上產生概率質量。


52. Intent Compiler

現在可以正式定義:

Γ:IhC.\Gamma: \mathcal I_h \rightarrow \mathcal C.

Γ\Gamma 是 Intent Compiler。


53. Compiler Input

自然語言
Reference
Project Memory
User Preference
Character Spec
World Rule
Task Type

54. Compiler Output

Hard Constraints
Soft Constraints
Constraint Weights
Providers
Conflict Graph
Search Budget
Evaluation Rules

55. AI Art Director 就是 Intent Compiler + Search Controller

定義:

Adirector=(Γ,Π,E),A_{\text{director}} = (\Gamma,\Pi,\mathcal E),

其中:

  • Γ\Gamma:意圖編譯;
  • Π\Pi:搜索/生成政策;
  • E\mathcal E:評估器。

56. Agent Loop

IntentCompileGenerateEvaluatePatchConstraintsGenerate.Intent \rightarrow Compile \rightarrow Generate \rightarrow Evaluate \rightarrow PatchConstraints \rightarrow Generate.

57. Feedback Control

這其實是一個閉環控制系統。

狀態:

St.S_t.

誤差:

et=TargetMetrics(It).e_t = Target-Metrics(I_t).

Agent 更新:

Ct+1=Update(Ct,et).\mathcal C_{t+1} = Update( \mathcal C_t,e_t ).

58. 2025 Feedback Editing 的佐證

FeedEdit 類方法已直接將 image editing 強度改成依歷史 editing error 動態調整,而不是全程固定 guidance strength。

這支持:

控制權重應該可以在生成過程中動態回饋調整。


59. Static Constraint 與 Dynamic Constraint

Static

整次生成不變:

角色身份
專案畫風
禁止文字

Dynamic

隨迭代調整:

prompt strength
detail strength
reference scale
style weight

60. Local Constraint

某些要求只作用區域:

Ci(IR).C_i(I\mid R).

例如:

臉
手
文字
服裝
背景

61. Spatial Constraint

定義 mask:

Mi(x,y).M_i(x,y).

則能量:

Ei(I)=x,yMi(x,y)ei(Ixy).E_i(I) = \sum_{x,y} M_i(x,y)e_i(I_{xy}).

62. 2025 顯式空間約束研究

近期工作直接將複雜 spatial condition 拆成 semantic condition 與 geometric condition,並在 test time 顯式 enforcing consistency。

這說明:

多約束控制開始從「提示」走向真正的約束執行。


63. Color Constraint

顏色本身也可以是幾何/分佈約束。

2025 Color Alignment 工作直接將 diffusion terms 投影到條件色彩空間,以維持指定 color pattern,同時保留生成多樣性。

這是一個非常乾淨的例子:

Constrain one visual dimension+leave others free.\text{Constrain one visual dimension} + \text{leave others free}.

64. 這與 Style Kernel 的關係

Style Kernel 不必把所有圖像細節鎖死。

它可以只限制:

色域
線條
材質
光影

讓:

內容
姿勢
構圖

保留自由度。


65. Subspace Constraint

理想地:

Ω=Ωstyle×Ωcontent×\Omega = \Omega_{\text{style}} \times \Omega_{\text{content}} \times \dots

但實際 latent 因素通常 entangled。

所以這是一個近似分解。


66. 解耦的價值

若:

StyleStyle

與:

ContentContent

可以更好解耦,

就能:

KcK_c\uparrow

而不使:

DvD_v\downarrow

太多。


67. Constraint Composition

設:

CA\mathcal C_A

控制人物,

CB\mathcal C_B

控制服裝,

CC\mathcal C_C

控制場景。

生成需要:

Compose(CA,CB,CC).Compose( \mathcal C_A, \mathcal C_B, \mathcal C_C ).

68. 組合不是簡單加權平均

如果條件在同一 latent channel 競爭:

Conflict>0.Conflict>0.

因此需要:

mask
stage
priority
model split
regional attention

等策略。


69. 2026 多主體 composition 的最新證據

近期 MultiCompose 類研究仍在處理:

多個 personalization subject
各自主體 identity
各自 attribute binding
空間重疊
attention collision

這直接說明:

多個條件同時存在,不代表模型會自動正確完成 conjunction。


70. Constraint Satisfaction 需要顯式工程

因此:

C1,C2,,CnC_1,C_2,\dots,C_n

不是丟進 Prompt 就算完成。

系統必須驗證:

Satisfied(Ci,I).Satisfied(C_i,I).

71. Evaluation as Constraint Checker

Evaluation Agent 可以算:

vi=Evaluate(Ci,I).v_i=Evaluate(C_i,I).

若:

vi<τi,v_i<\tau_i,

則 Retry。


72. 約束結果向量

v(I)=(v1,,vm).\mathbf v(I) = (v_1,\dots,v_m).

73. Pareto Front

如果兩個 soft objective 互相衝突:

極高風格一致性
極高構圖自由度

可能沒有單一全局最佳。

此時應找 Pareto Set:

P.\mathcal P.

74. 使用者選擇工作點

例如:

Fidelity
Balanced
Creative

其實是在 Pareto front 上選不同點。


75. 約束域與控制面

本文定義:

U\mathcal U

為可控制變量集合:

prompt
model
LoRA
reference
control
seed
sampler
guidance
mask
workflow

76. Control Surface

uU.u\in\mathcal U.

生成:

I=F(u).I=F(u).

Intent Compiler 的問題是:

u=argmaxuJ(F(u)Intent).u^\star = \arg\max_u J(F(u)\mid Intent).

77. 這是一個黑箱優化問題

對大型生成軟體:

FF

往往不可解析。

所以 Agent 可以使用:

Bayesian optimization
evolutionary search
bandit
LLM planning
heuristic search
human feedback

78. 不一定需要梯度

Constraint Solver 可以:

  • gradient-based;
  • gradient-free;
  • sampling-based;
  • search-based;
  • hybrid。

79. 生成工作流本身也是搜索變量

不只是:

λ.\lambda.

甚至:

WorkflowWorkflow

也可變。

例如:

先生成再 Control
vs
先 Control 再 inpaint

結果不同。


80. Workflow Search

因此:

π=argmaxπΠJ(Generate(π)).\pi^\star = \arg\max_{\pi\in\Pi} J( Generate(\pi) ).

81. AI Art Direction 的真正難度

它不是:

幫你寫 Prompt。

而是同時搜索:

(Model,Adapter,Reference,Control,Weights,Workflow,Seed,Evaluation).( Model, Adapter, Reference, Control, Weights, Workflow, Seed, Evaluation ).

82. Constraint Engineering

因此定義:

ConstraintEngineering=Design + Weight + Compose + Evaluate Constraints\boxed{ ConstraintEngineering = \text{Design + Weight + Compose + Evaluate Constraints} }

83. Prompt Engineering 是其中子集

PromptEngineeringConstraintEngineering.\boxed{ PromptEngineering \subset ConstraintEngineering. }

84. 生成不是尋找唯一真值

對創作生成:

ΩC|\Omega_C|

應該通常大於 1。

我們尋找的是:

多個可接受候選。


85. Sampling 問題

因此目標可以是:

I1,,Ikp(IC).I_1,\dots,I_k \sim p^\star(I\mid\mathcal C).

86. Candidate Set

然後再求:

S=argmaxSQuality(S)+λDiversity(S).\mathcal S^\star = \arg\max_{\mathcal S} Quality(\mathcal S) + \lambda Diversity(\mathcal S).

87. 搜索與選擇分離

生成:

Sample.Sample.

評估:

Rank.Rank.

最終:

Select.Select.

88. 這更符合人類藝術流程

人類也常:

草圖多個
挑方向
深化
淘汰

所以 Agentic Generation 並不需要一次命中唯一圖。


89. 「特定畫」與「滿意畫」的區別

若使用者真的知道 exact raster:

I,I^\star,

那就是 reconstruction / reproduction。

但通常使用者只知道:

Acceptable(I)=1.Acceptable(I)=1.

所以目標是:

IΩacceptable.I\in\Omega_{\text{acceptable}}.

90. Intent 是集合描述

這是一個重要結論:

HumanIntentdescription of a desired set, not a single raster point.\boxed{ HumanIntent \approx \text{description of a desired set, not a single raster point}. }

91. 意圖解析誤差

Agent 對意圖的理解:

C^\hat{\mathcal C}

可能不等:

C.\mathcal C^\star.

所以人機溝通也是搜索的一部分。


92. Human Feedback 重新收縮域

人說:

「對,但臉不要這麼 AI。」

這等於新增:

C¬genericface.C_{\neg generic-face}.

因此:

Ωt+1=ΩtΩ¬genericface.\Omega_{t+1} = \Omega_t \cap \Omega_{\neg generic-face}.

93. 或改變 soft energy

如果不是絕對禁止:

λgeneric-face.\lambda_{\text{generic-face}} \uparrow.

94. 對話生成就是逐步約束

因此多輪人機對話:

C0C1CT.\mathcal C_0 \rightarrow \mathcal C_1 \rightarrow \dots \rightarrow \mathcal C_T.

可視為:

逐輪建立更準確的目標子域。


95. AI 自己也可以提出約束

若 Agent 發現:

角色很像,但服裝漂移

可以提出:

Ccostume-consistency.C_{\text{costume-consistency}}.

96. Meta-Constraint

甚至可以定義:

約束如何被修改的規則。

例如:

風格核不可低於 0.8
但允許其他權重自動探索

這是:

Cmeta(C).C_{\text{meta}}(\mathcal C).

97. 搜索預算

生成不是無限。

定義:

B=(GPUTime,Samples,Money,Latency).B= ( GPUTime, Samples, Money, Latency ).

求:

maxJ\max J

subject to:

CostB.Cost\leq B.

98. Agent 因此是 bounded solver

它不是全能神。

它是在:

有限模型
有限算力
有限時間
有限工具

下近似解:

maxJ.\max J.

99. 生成失敗重新定義

生成失敗不一定是:

圖壞了。

也可能:

  1. ΩC=\Omega_C=\varnothing
  2. ΩC\Omega_C 非空但模型不可達;
  3. Provider 失配;
  4. 搜索預算不足;
  5. Evaluation 錯;
  6. Intent Compiler 錯。

100. 六種 Failure

F1 Constraint Contradiction

ΩC=.\Omega_C=\varnothing.

F2 Reachability Failure

ΩCΩG=.\Omega_C\cap\Omega_G=\varnothing.

F3 Search Failure

交集非空,但沒找到。

F4 Representation Failure

模型 representation 不足。

F5 Evaluation Failure

找到好圖但 evaluator 誤殺。

F6 Intent Failure

約束根本不是人真正想要的。


101. 這對理論修正很重要

以前我們可能把所有失敗說:

模型不好。

其實應該診斷在哪一層。


102. 可達域與 Paper 03

Paper 03 將專門研究:

Ωhuman,ΩG,ΩΣ.\Omega_{\text{human}} , \Omega_G , \Omega_\Sigma.

本文只需先指出:

ΩCΩG\Omega_C \cap \Omega_G

才是某一模型在某次任務中的真正可解域。


103. 核心公式

最簡集合形式:

Ω=ΩGiΩi\boxed{ \Omega^\star = \Omega_G \cap \bigcap_i\Omega_i }

104. 軟約束形式

I=argminIΩGiλiEi(I)\boxed{ I^\star = \arg\min_{I\in\Omega_G} \sum_i\lambda_iE_i(I) }

subject to hard constraints。


105. 概率形式

p(I)pG(I)iψi(I)λi\boxed{ p^\star(I) \propto p_G(I) \prod_i \psi_i(I)^{\lambda_i} }

106. 控制政策形式

u=argmaxuUJ(F(u)Intent)\boxed{ u^\star = \arg\max_{u\in\mathcal U} J(F(u)\mid Intent) }

107. Agentic Loop

IntentCompileGenerateEvaluateUpdate\boxed{ Intent \rightarrow Compile \rightarrow Generate \rightarrow Evaluate \rightarrow Update }

108. 與 GVSS Paper 01 的連接

Paper 01:

IΩΣ.I\in\Omega_\Sigma.

Paper 02:

IΩCΩGΩΣ.I^\star \in \Omega_C \cap \Omega_G \subseteq \Omega_\Sigma.

109. 與 AI Art Direction 論文的連接

先前論文指出:

PromptEngineeringConstraintEngineering.PromptEngineering \subset ConstraintEngineering.

本文現在給出底層數學:

Prompt 是 ψp\psi_pEpE_p 的一種 Provider;LoRA、Reference、Control、Style Kernel 只是其他約束 Provider。


110. 與 AADS 的連接

AADS:

Art Director Agent
Constraint Graph
Style Recipe
Registry
Workflow Compiler
Evaluation

現在可被解釋成:

對視覺空間約束求解器的工程實作。


111. 與 Generative Asset Registry 的連接

Generative Asset:

model
LoRA
reference
adapter
control
recipe

皆可被理解為:

修改 ΩG\Omega_GpGp_Gψi\psi_iEiE_i 或搜索政策 π\pi 的導航資產。


112. 與 PCFT 的連接

PCFT reconstruction:

D(H)L.D(H)\approx L.

這本身就是 hard / soft observation constraint。

所以 PCFT 也可以納入:

ConstraintDomainSolver.ConstraintDomainSolver.

113. 統一視覺生成與重建

創作生成:

語意
風格
構圖

重建:

measurement
fidelity

都可以表示成:

{Ci}.\{C_i\}.

差別只是約束類型與權重。


114. 這提供統一 Runtime 可能性

VisualRuntime=GenericConstraintSolver+GenerativeProviders\boxed{ VisualRuntime = GenericConstraintSolver + GenerativeProviders }

115. 可驗命題 H1:多約束優於 Prompt-only

在高控制需求任務:

Success(Prompt+Reference+Structure+Style)>Success(PromptOnly).Success( Prompt+Reference+Structure+Style ) > Success( PromptOnly ).

116. H2:約束越多不一定越好

存在:

mm^\star

使得約束增加到一定程度後:

DiversityDiversity\downarrow

或:

Conflict.Conflict\uparrow.

117. H3:動態約束優於固定權重

在需要多階段生成/編輯的任務:

J(λt)>J(λfixed)J( \lambda_t ) > J( \lambda_{\text{fixed}} )

在某些域成立。


118. H4:Agent 可降低人類控制成本

定義人工時間:

Th.T_h.

如果:

Tagent<TmanualT_{\text{agent}} < T_{\text{manual}}

且:

QagentQmanual-novice,Q_{\text{agent}} \geq Q_{\text{manual-novice}},

則代理控制具實用增益。


119. H5:Intent Compiler 可學習判定域

隨著:

FeedbackFeedback

累積,

Error(C^,C).Error( \hat{\mathcal C}, \mathcal C^\star ) \downarrow.

120. 實驗設計一:Constraint Ladder

同一任務:

A Prompt
B Prompt + Reference
C + Structure
D + Style Adapter
E + Project Recipe

比較:

Adherence
Style
Identity
Diversity
Time
Retries

121. 實驗二:Conflict Matrix

刻意設定互相衝突的:

Style
Reference
Control

測:

人類手調
Agent conflict solver
固定權重

122. 實驗三:Constraint Volume Proxy

無法直接測:

ΩC.|\Omega_C|.

但可以固定 workflow,大量 sample,測:

embedding spread
semantic spread
style spread
composition spread

作剩餘自由度 proxy。


123. 實驗四:Dynamic Guidance

比較:

fixed guidance
feedback-adjusted guidance

測:

constraint satisfaction
quality
artifact

124. 實驗五:Human Dialogue

每輪只給一個修正:

Round 0 broad intent
Round 1 style
Round 2 face
Round 3 costume

觀察:

Ωt\Omega_t

的 proxy 是否逐步收斂。


125. 理論邊界

本文不主張:

  1. 人類意圖能完全形式化;
  2. 所有美學偏好都可微;
  3. 所有約束能無衝突組合;
  4. diffusion guidance 等同精確 constraint satisfaction;
  5. 生成模型可達所有滿足約束的圖像;
  6. 最佳圖像唯一存在。

126. 真正主張

本文真正主張:

視覺生成可以被有用地建模為:在生成模型可達域中,根據人類意圖編譯出的硬/軟/概率/結構約束進行搜索、優化或採樣。


127. 從「畫圖」到「導航」

這個框架改變問題語言。

不是:

AI 會不會畫?

而是:

AI 在哪些視覺域可導航?

以及:

人類意圖能否被有效編譯成導航條件?


128. 從「Prompt」到「Constraint Program」

未來使用者說:

「不要 AI 網紅臉。」

系統不一定只增加 Negative Prompt。

它可以編譯:

Negative Prompt
Face Diversity Constraint
Reference Pool
Identity Evaluator
Genericness Penalty
Candidate Diversity Selection

即:

IntentProgram.Intent \rightarrow Program.

129. Constraint Program

定義:

PC=(C,Λ,P,Π,E).P_C = ( \mathcal C, \Lambda, \mathcal P, \Pi, \mathcal E ).

其中:

  • C\mathcal C:約束;
  • Λ\Lambda:權重;
  • P\mathcal P:Provider;
  • Π\Pi:Workflow / Search Policy;
  • E\mathcal E:Evaluator。

130. 這就是 AI-native 生成的真正中間表示

人類不應直接操縱:

CFG 7.2
LoRA 0.68
ControlNet 0.52

而應描述:

角色身份高
構圖自由中
專案風格高
臉部多樣高

Compiler 再產生數值與工作流。


131. 結論

前篇證明,在固定有限數位圖像規格下,每一張具體 raster image 都是高維有限狀態空間中的一個資料點。

本文進一步提出:

生成真正困難的部分,不是「讓計算機存在一個像素排列」,而是如何從極端巨大的視覺空間中,高效導航到人類真正想要的受約束區域。

因此:

Visual Generation=Constraint-Domain Solving\boxed{ \text{Visual Generation} = \text{Constraint-Domain Solving} }

其中完整有效域為:

Ω=ΩGΩhardΩsoft-effective\boxed{ \Omega^\star = \Omega_G \cap \Omega_{\text{hard}} \cap \Omega_{\text{soft-effective}} }

或概率形式:

p(I)pG(I)iψi(I)λi\boxed{ p^\star(I) \propto p_G(I) \prod_i \psi_i(I)^{\lambda_i} }

人類 Intent 通常不是單一圖像地址,而是某個可接受集合的模糊描述:

HumanIntentA partial specification of a desired visual subset\boxed{ HumanIntent \approx \text{A partial specification of a desired visual subset} }

所以 AI Art Director 的本質不是幫使用者「寫更厲害的 Prompt」,而是:

IntentConstraintCompilationSearchPolicySamplingEvaluationRefinement\boxed{ Intent \rightarrow ConstraintCompilation \rightarrow SearchPolicy \rightarrow Sampling \rightarrow Evaluation \rightarrow Refinement }

Prompt、LoRA、Reference、ControlNet、Style Kernel、Model、Seed、Sampler、Workflow 等,都可以在這個理論中重新定位為:

改變可達域、概率密度、約束能量或搜索路徑的導航變量。

這使前篇的「全域視覺空間」與後續的 AI Art Direction、AADS、PCFT、Generative Asset Registry 得到共同數學語言。

下一篇將把問題再往外推一步:

如果 ΩΣ\Omega_\Sigma 是所有可表示圖像, ΩG\Omega_G 是某一 AI 模型的可達域,而 Ωhuman\Omega_{\text{human}} 是人類歷史上真正實現過的圖像集合,那麼三者之間到底是什麼關係?AI 是否已能到達大量「從未被人類實現、但具語意與美學合法性」的視覺區域?

這將是 Paper 03「生成可達域與未實現視覺」的核心問題。


參考文獻

  1. Ho, J., Salimans, T. Classifier-Free Diffusion Guidance. arXiv:2207.12598, 2022.
  2. Liu, N., Li, S., Du, Y., Torralba, A., Tenenbaum, J. B. Compositional Visual Generation with Composable Diffusion Models. arXiv:2206.01714, 2022.
  3. Bansal, A. et al. Universal Guidance for Diffusion Models. arXiv:2302.07121, 2023.
  4. Zhang, L., Rao, A., Agrawala, M. Adding Conditional Control to Text-to-Image Diffusion Models. ICCV 2023.
  5. Chung, H. et al. Diffusion Posterior Sampling for General Noisy Inverse Problems. arXiv:2209.14687, 2022.
  6. Chung, H., Sim, B., Ryu, D., Ye, J. C. Improving Diffusion Models for Inverse Problems using Manifold Constraints. arXiv:2206.00941, 2022.
  7. Kong, L. et al. Diffusion Models as Constrained Samplers for Optimization with Unknown Constraints. arXiv:2402.18012, 2024.
  8. Zhang, Z. et al. Test-time Controllable Image Generation by Explicit Spatial Constraint Enforcement. arXiv:2501.01368, 2025.
  9. Shum, K. C., Hua, B.-S., Nguyen, D. T., Yeung, S.-K. Color Alignment in Diffusion. CVPR 2025.
  10. Fu, F., Zhang, L., Huang, M., Mao, Z. FeedEdit: Text-Based Image Editing with Dynamic Feedback Regulation. CVPR 2025.
  11. Khalafi, S., Hounie, I., Ding, D., Ribeiro, A. Composition and Alignment of Diffusion Models using Constrained Learning. arXiv:2508.19104, 2025.
  12. Zhang, R., Zhao, Z., Gao, P. MultiCompose: Multi-Concept Personalized Composition with Per-Subject Attribute Binding. arXiv:2608.03708, 2026.

研究狀態

本文包含三種不同層級的內容:

已有理論/工程支持的結構

  • conditional generation 可被視為分佈重加權;
  • classifier-free guidance 存在 quality–diversity trade-off;
  • text prompt 對精細空間控制不足;
  • diffusion 可組合多個能量/guidance;
  • inverse-problem generation 可加入 measurement / manifold constraints;
  • sampling-time feedback 與顯式 spatial enforcement 已有實作研究。

本文提出的統一抽象

  • Constraint Domain;
  • Intent Compiler;
  • Constraint Program;
  • Generation Address vs Raster Address;
  • Constraint Capacity;
  • 六類 Failure Diagnosis;
  • AADS 作為約束域求解器。

待驗命題

  • 人類 Intent 是否能被穩定編譯為可重用 Constraint Program;
  • Agent 是否能實際降低人工調參成本;
  • Constraint Volume / Remaining Freedom 是否存在有效 proxy;
  • Dynamic Constraint Policy 是否在專案級生成中穩定優於固定控制;
  • Style Kernel 與 Diversity 是否可形成可靠 Pareto 控制面。