生成式AI之AI詠唱師
牛刀小試1
以下哪一張圖是AI生成的?
觀察一下AI生成的圖片出現了什麼問題?
AI生成圖片原理
資料引用:政大蔡炎龍教授
資料引用:台大李宏毅教授
AI生成圖片三大天王
牛刀小試2
使用Git進行軟體開發和版本控制的網路託管服務的平台
AI界的GitHub平台-Hugging Face – The AI community building the future.
https://github.com/AUTOMATIC1111/stable-diffusion-webui
https://github.com/camenduru/stable-diffusion-webui-colab
Painting, cat, wearing a suit, natural light, in the sky, using bright colors, 3D render A 3D rendered painting of a cat wearing a suit, in the sky, with natural light and bright colors. |
如果希望生成一張兩位女生在紐約/東京,是逛街/跳舞的圖片,可以提供以下關鍵字:「兩個女生、紐約/東京、跳舞/逛街」。這樣的描述將有助於模型更準確地生成符合期望的圖片。
newyork street, shopping, clear sky, city, masterpeice, high quality, realistic, ultra detail, cute, photshoot, 2 girls, cute Negative promp ugly, worst quality, low resolution, blurred, blurry, bad anatomy, bad proportion, poorly drawn hands, malformed limbs, malformed hands, malformed arms, malformed fingers, tiling, cut off,(worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality |
其他範例
<lora:cuteGirlMix4_v10:0.4>, <lora:taiwanDollLikeness_v10:0.6>,mix4,(8k, RAW photo, best quality, masterpiece:1.2), (realistic, photo-realistic:1.37),((1girl)),portrait,float hair, professional lighting, photon mapping, radiosity, physically-based rendering,lens 135mm,f1.8,close-up,head out of frame
EasyNegative, paintings, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), (((grayscale))), skin spots, acnes, skin blemishes, age spot, glans,extra fingers,fewer fingers,strange fingers,bad hand,backlight, (worst quality, low quality:1.4), watermark, logo, ((bad anatomy)),fat,mutated hands, polar lowres, bad body, bad proportions, gross proportions, missing arms, ((missing legs,.miss feet,bad feet)), poorly drawn hands,bad anatomy, bad hands, extra digit, fewer digits,extra fingers, fewer digits, extra limbs, |
{{{furry male}}}, {{{cat boy}}},white shirt, blue lowres, bad anatomy, bad |
AI 繪圖新手詠唱2
https://vocus.cc/article/64266191fd89780001309663
https://ithelp.ithome.com.tw/articles/10310197
1.製作出好的prompt必須從問一系列問題開始:
您想要照片還是畫作? =>畫作
主題是什麼?人物?動物還是風景? =>貓
您想添加哪些細節?
特殊燈光。柔和、環境、環形燈、霓虹 =>自然光
環境。室內、室外、水下、太空中 =>在天空中
色彩方案。鮮豔、黑暗、柔和色調 =>使用明亮的顏色
畫面風格?3D渲染、吉卜力工作室、電影海報 => 3D渲染
2.善用ChatGPT- Ai繪圖 prompt生成器3.Stable Diffusion Prompt 優化步驟5步驟
步驟1. 簡易換行用3段式表達
掌握核心概念,並用分段進行說明。
步驟2. prompt第一段填上畫質和畫風關鍵字
畫質和畫風,例如photo、painting、oil painting。
步驟3. 第2段強調畫面主體與細節
主體細節概括人、事、物、景等畫面核心內容,例如:人物主要特徵、主要動作、物體主要特徵、主景或景色大框架。畫面細節例如:人數。
步驟4. 第3段補充畫面場景細節(或人物細節)
常見放在這段的說明是 highly detailed clothes, green engravings on clothes, embarrassed laughing, the overall tone of the image is happy.
步驟5. 重複嘗試與優化
不同模型(ckpt)對 Prompt 的敏感程度不同,一套完善的 prompt 在不同的模型中,表達效果會有差異。每個模型都有自己的特色,需根據模型特色,慢慢調試 prompt 組合。
其他範例
<lora:cuteGirlMix4_v10:0.4>, <lora:taiwanDollLikeness_v10:0.6>,mix4,(8k, RAW photo, best quality, masterpiece:1.2), (realistic, photo-realistic:1.37),((1girl)),portrait,float hair, professional lighting, photon mapping, radiosity, physically-based rendering,lens 135mm,f1.8,close-up,head out of frame
EasyNegative, paintings, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), (((grayscale))), skin spots, acnes, skin blemishes, age spot, glans,extra fingers,fewer fingers,strange fingers,bad hand,backlight, (worst quality, low quality:1.4), watermark, logo, ((bad anatomy)),fat,mutated hands, polar lowres, bad body, bad proportions, gross proportions, missing arms, ((missing legs,.miss feet,bad feet)), poorly drawn hands,bad anatomy, bad hands, extra digit, fewer digits,extra fingers, fewer digits, extra limbs, |
drybrush speed painting of a boy sitting and looking |
photo of an amazing loaded snozboffle milkshake. |
photo of an amazing loaded snozboffle milkshake. |
A hyperdetailed photo of a beautiful and clean RPG |
{{{furry male}}}, {{{cat boy}}},white shirt, blue |
in summer, against backlight at dusk, girl, |
牛刀小試3
1.點開colab後,執行程式碼
2.執行完畢後,底下會出現4個Public WebUI Colab URL點擊任一個後即可進入webui的 頁面
3.輸入Prompt後,按Generate
更多範例及解說
進階研究
1.穩定擴散(Stable Diffusion)第三方模型的集合站
2.如何在Google drive上安裝Stable Diffusion (using colab)
https://www.youtube.com/watch?v=4Q24HStDDMA
複製以下的筆記本網址
https://www.youtube.com/watch?v=AE2e6E-XVbc
Stable Diffusion檔案安裝在個人雲端硬碟
3.安裝Stable Diffusion在本機端 ( 強力的顯卡,建議是NVIDIA的卡並且顯卡記憶體有6GB以上(NVIDIA的卡在跑這套繪圖模組上會比較有利)
https://vocus.cc/article/63f87151fd89780001283144
Stable Diffusion WebUI使用手冊
https://github.com/ivon852/stable-diffusion-webui-manuals
https://ivonblog.com/posts/stable-diffusion-webui-manuals/features/prompt-guide/
https://mnya.tw/cc/word/tag/stable-diffusion-web-ui
4.中文化擴充
https://github.com/benlisquare
https://github.com/journey-ad/sd-webui-bilingual-localization
5.穩定擴散(Stable Diffusion)外掛插件-Multi-ControlNet
https://github.com/lllyasviel/ControlNet
牛刀小試4
create an image of a large green landscape |
The Starry Night, Vincent van Gogh , |
牛刀小試5
其他研究
LINE BOT 教學 ( Python )
open-pose
教學資源
https://www.youtube.com/watch?v=xDuRgr1u3Es
https://www.youtube.com/playlist?list=PL4L5yXcAegdxwcD2RRffQntmXygv26auT
https://www.youtube.com/watch?v=F08QdMSuCw8