**SD-24 tex2img & img2img 基本操作(T-Group)**

**推薦的學習影片**
【生成式AI導論 2024】台大李宏毅教授線上課程
https://www.youtube.com/watch?v=AVIKFXLCPY8&list=PLJV_el3uVTsPz6CTopeRp2L2t4aL_KgiI&index=2
**上傳圖片就能獲得生成這張的Prompt提示指令**
最好要將它生成的文字 檢查刪減後再用
https://imagetoprompt.com/

**先認識 熟悉WebUI的操作介面**

**Lora的圖片如何顯示**
需安裝Civitai Helper執行Scan後 就會下載Lora圖片至檔案中

Lora下載可在資料夾中進行分類 依類別放置Lora檔案




**tex2img(文生圖)的基本操作**
Prompt: masterpiece,best quality,....
Negative Prompt: ugly,normal,
masterpiece, best quality, modern Office Building, building facade, scenery, outdoors, sky, day, tree, ground vehicle, motor vehicle, walking, city, car, road, real world location,background,4K uhd,
(傑作, 最佳品質, 現代辦公大樓, 建築立面, 風景, 戶外, 天空, 天, 樹, 地面車輛, 摩托車, 步行, 城市, 汽車, 道路, 真實世界位置,4K uhd,)
(RAW photo,subject,8k uhd,dslr,soft lighting,high quality,film grain,Fujiflm XT3,)
(RAW 照片、主體、8k 超高清、數位單眼相機、柔和的燈光、高品質、底片顆粒、Fujiflm XT3、)
photography, dynamic view, minimalist design, Canon EOS 5D Mark IV, EF 24mm f/1. 4L II USM lens, set f/2. 8, depth of field that highlights architectural photography,
(攝影、動態取景、簡約設計、Canon EOS 5D Mark IV、EF 24mm f/1。 4L II USM 鏡頭,設定 f/2。突顯建築攝影的景深,)


masterpiece,best quality,modern office,lobby with a red and white reception table and a large wall mural,bright,interior design,architecture photograph,
(傑作,最佳品質,現代辦公室,大廳配有紅白接待桌和大型壁畫,明亮,室內設計,建築照片)



**img2img(圖生圖)的基本操作**

**底圖一**
原底圖大小3840x2160 先將圖片resize 運算速度與效果會差很大
resize成 512x288(適合設備較差的) or 1024x576(適合設備較好的)

512x288

1024x576

在圖生圖(img2img)中放入底圖 正向與反向提示詞

注意要將畫布尺寸調整與底圖一致 控制重繪幅度(Denoising strength)參數 重繪的臨界值約為0.7

Prompt:masterpiece,best quality,office lobby,modern minimalist,lobby with a red and white reception table and a large wall mural,bright,interior design,architecture photograph,
Negative Prompt:16-token-negative-deliberate-neg,EasyNegative,realisticvision-negative-embedding,FastNegativeV2,
即可進行圖生圖運算


**加入Lora讓效果更突出**
在正向提示詞後面 加上LoRA model 可以微調風格及增加效果







**inpaint局部重繪**
用筆刷塗抹要修改的區域

在正向提示詞:dark floor,black marble,


**PNG Info 可以看到我用SD生成圖片的所有資訊**
