概述
圖像模型是將文字映射到視覺特徵,而不是像聊天模型那樣遵循指令,因此描述性的詞彙以及了解模型的語法,是區分通用結果與你心中實際畫面關鍵。
深入探討
A strong image prompt reads like a description of a finished picture. A useful order is subject first (who or what, doing what), then medium (photograph, oil painting, 3D render, pencil sketch), style or era (art nouveau, 1970s film still), lighting (soft diffused, rim light, neon), composition and camera (close-up, wide shot, low angle, 35mm lens, shallow depth of field), color palette, and finally aspect ratio. Specific nouns beat adjectives: "a weathered fisherman mending nets" gives the model more to work with than "an interesting old man." How you phrase this depends on the model. Older Stable Diffusion models use a CLIP text encoder and respond well to comma-separated keywords, and they only read a limited number of tokens. Newer systems such as DALL-E 3, Imagen and FLUX use stronger language encoders and handle full sentences, spatial relationships and text in the image far better. In ChatGPT, DALL-E 3 prompts are rewritten by the chat model before generation, so what you type is not exactly what the image model receives. Prompting images differs from prompting chat models. An image model is not reasoning about your request; it associates words with visual features. That explains the most common mistake: writing "a beach with no people" can add people, because the word "people" is present. Use a negative prompt field or Midjourney's --no parameter instead. Polite instructions, explanations of purpose and long backstories usually add noise. Other misconceptions: quality tags like "masterpiece, 8k, best quality" helped some older community models but do little on many modern ones, and longer prompts are not automatically better, since extra terms compete for influence. The reliable method is iteration: fix the seed, change one element at a time, and keep notes on which words produced which effects.
現實世界的實施
一位小企業主將「拍一張我們蠟燭的好照片」改為「琥珀色玻璃蠟燭的產品照,放在胡桃木桌上,左側有柔和的窗光,淺景深,奶油色背景」,結果得到了一張可用的目錄圖片。
一位老師為了說明課程內容,寫下「水循環圖的平面向量插圖,明亮的原色,乾淨的線條,白色背景」,並將標籤文字放在引號中,以便較新的模型能渲染出這些文字。
一位 Stable Diffusion 使用者如果一直得到類似浮水印的文字,會在負面提示詞欄位中加入「text, watermark, signature」,而不是在主要提示詞中寫「no text」。
一位 Midjourney 的概念藝術家會固定種子,然後僅將光影短語從「陰天」改為「黃金時刻逆光」,以便在不改變構圖的情況下比較氛圍。
撰寫有效圖像生成提示詞的未來
隨著圖像生成功能被內建到可以在多輪對話中編輯圖像的聊天助理中,提示詞工程正從關鍵字技巧轉向平實的對話。更好的文字編碼器正在穩步改善文字渲染、物件數量和空間佈局。除了文字之外的控制方式,例如參考圖像、風格參考、草圖、姿勢引導和區域提示詞,正逐漸成為標準,這減少了必須在文字中描述的內容。無論使用什麼介面,這些基礎知識很可能依然有用:了解光影、構圖、鏡頭和藝術史的詞彙,能讓你精確表達你的意圖。
付諸實踐
為什麼這很重要
- 速度與規模. 視覺人工智慧可以大規模自動化檢查、檢測和標記任務。
- 配裝選擇. 創意團隊可以透過更少的手動修改來更快地建立概念原型。
- 團隊與工作流程. 操作可以使用以前難以處理的影像和視訊訊號。
留意
- 如果出處不明,肖像權和同意可能會成為法律風險。
- 模型表現可能因光照、人口統計和環境的不同而有所不同。
- 除非監控置信閾值,否則誤報可能會被忽略。
後續步驟
- 定義精確度、召回率和錯誤成本的接受標準。
- 使用符合實際生產條件的數據進行測試。
- 為低置信度或高影響力的預測添加人工審核。
- 追蹤模型漂移並在相機或資料集變更後重新驗證。
不斷探索
常見問題
什麼是「撰寫有效圖像生成提示詞」?
一個有效的圖像生成提示詞會描述你想要的畫面:主體、媒介、風格、光影、構圖和相機設定,這些都要表達得清晰且具體,而不是要求模型去執行一項任務。圖像模型是將文字映射到視覺特徵,而不是像聊天模型那樣遵循指令,因此描述性的詞彙以及了解模型的語法,是區分通用結果與你心中實際畫面關鍵。
根據指南,在結構良好的圖像提示詞中,哪個元素通常應該放在最前面?
從主體開始,可以在疊加媒介、風格、光影和構圖之前,先告訴模型這張圖片的主題是什麼。
為什麼「a beach with no people」(沒有人的海灘)可能會產生一張有人物的圖片?
「people」這個詞會將人物拉入圖片中。使用負面提示詞欄位或 --no 參數是排除某物的可靠方法。
在 AUTOMATIC1111 風格的 Stable Diffusion 介面中,(red scarf:1.3) 有什麼作用?
數值代表權重。大於 1 的值會強化片語的影響力;小於 1 的值則會減弱它。
負面提示詞在無分類器引導(classifier-free guidance)下如何影響生成?
引導通常是從無條件預測朝著提示詞的方向移動。以負面提示詞替代該基準,可以避開它所描述的內容。
在調校提示詞時,固定隨機種子(seed)的主要目的為何?
隨機種子決定了起始雜訊。保持其固定,能讓不同版本的提示詞之間的比較具有意義。