aiArt - depth2img功能測試
「aiArt」
這次的主題:depth2img功能測試
depth2img是StableDiffusion 2.0的新功能,和img2img一樣都是用來改造圖,不過img2img在改造上常常會產生很大的形變,因而破壞原有的構圖,而depth2img則可以盡量減少形變、在保持構圖上進行改造圖
其原理是先產生原圖的depth map深度圖,AI會自動判斷每個點的景深值,然後產生出來的改造圖會盡量保持擁有相近的深度圖,由此來避免破壞原本的構圖
要注意的是,depth2img目前好像只能用特製的模組512-depth-ema.ckpt實現,其他的模組還沒辦法用這個功能,下載連結為: https://huggingface.co/stabilityai/stable-diffusion-2-depth/resolve/main/512-depth-ema.ckpt
使用時需要在同資料夾放上這個檔案,記得要改名成512-depth-ema.yaml : https://raw.githubusercontent.com/Stability-AI/stablediffusion/main/configs/stable-diffusion/v2-midas-inference.yaml
因為載入時耗費的記憶體會比舊版的要大,所以之前的免費使用的colab版會沒辦法用,需要使用別人優化程式碼過的版本: https://colab.research.google.com/github/TheLastBen/fast-stable-diffusion/blob/main/fast_stable_diffusion_AUTOMATIC1111.ipynb#scrollTo=PjzwxTkPSPHf
這個版本即便載入較大的2.1模組檔也沒問題,記得點選那個Large_Model
這次使用的原圖是上次發過的人像照(圖一)
圖二是經過改造後就能產生出金髮白人的照片,而且可以看出大致保持相同的構圖和五官位置
圖三則是改造成青花瓷的人偶的照片
圖四是改造成大理石的雕像
圖五是把圖四當作原圖改造成的玉石像,可以發現當主題接近時(都是雕像),越不容易產生形變
-----------------------
depth2img算是蠻好用的功能,期待未來其他的模組也能使用這個功能
之前有看到有人用來自動產生3D貼圖,這功能感覺很快就會被大量商用:
https://twitter.com/CarsonKatri/status/1600248599254007810
-----------------------
使用的咒文和參數:
金髮白人
(front portrait) of young blonde student girl,long straight blonde hair,(straight side part fringe) ,(skin pores),makeup,perfect face,(young face:1.2),blush,(dark eye shadow:0.1),
(((best quality))),highres,
((ultra-detailed)),((an extremely delicate and beautiful)),(best photo),(professional photograph),(best shadow),(beautiful light and shadow),
cinematic lighting,
********
Negative prompt:
(blurry:1.9),(vague:1.9),cropped,out of frame,worst quality,low quality,normal quality,jpeg artifacts,lowres,ugly,poor drawing,poor painting,
drawing,painting,poor 3D,poor photo,amateur,
hand,finger,arm,close up,
bad,weird,distorted,malformed,broken,error,wrong,dirty,unclean,
poor drawing picture,poor drawing line,
dirty drawing,dirty painting,dirty drawing line,
unclean drawing,unclean painting,unclean drawing line,
********
Steps: 20, Sampler: DDIM, CFG scale: 7, Seed: 2578675247, Size: 800x800, Model hash: d0522d12, Denoising strength: 1, Mask blur: 4
------------------------------------------------
青花瓷人像
blue and white porcelain statue,
(((best quality))),highres,
((ultra-detailed)),((an extremely delicate and beautiful)),(best photo),(professional photograph),(best shadow),(beautiful light and shadow),
********
Negative prompt:
(blurry:1.9),(vague:1.9),cropped,out of frame,worst quality,low quality,normal quality,jpeg artifacts,lowres,ugly,poor drawing,poor painting,
drawing,painting,poor 3D,poor photo,amateur,
bad,weird,distorted,malformed,broken,error,wrong,dirty,unclean,
poor drawing picture,poor drawing line,
dirty drawing,dirty painting,dirty drawing line,
unclean drawing,unclean painting,unclean drawing line,
********
Steps: 20, Sampler: LMS Karras, CFG scale: 7, Seed: 3981807695, Size: 704x704, Model hash: d0522d12, Denoising strength: 1, Mask blur: 4
------------------------------------------------
大理石雕像
delicate clean white statue in clean white marble,perfect face,delicate clean white statue hair,
(((best quality))),highres,
((ultra-detailed)),((an extremely delicate and beautiful)),(best photo),(professional photograph),(best shadow),(beautiful light and shadow),
********
Negative prompt:
(blurry:1.9),(vague:1.9),cropped,out of frame,worst quality,low quality,normal quality,jpeg artifacts,lowres,ugly,poor drawing,poor painting,
drawing,painting,poor 3D,poor photo,amateur,
bad,weird,distorted,malformed,broken,error,wrong,dirty,unclean,
poor drawing picture,poor drawing line,
dirty drawing,dirty painting,dirty drawing line,
unclean drawing,unclean painting,unclean drawing line,
********
Steps: 20, Sampler: DDIM, CFG scale: 7, Seed: 2216612847, Size: 704x704, Model hash: d0522d12, Denoising strength: 1, Mask blur: 4
------------------------------------------------
玉石像
green jade statue,perfect face,green jade stone,
(((best quality))),highres,
((ultra-detailed)),((an extremely delicate and beautiful)),(best photo),(professional photograph),(best shadow),(beautiful light and shadow),
********
Negative prompt:
(blurry:1.9),(vague:1.9),cropped,out of frame,worst quality,low quality,normal quality,jpeg artifacts,lowres,ugly,poor drawing,poor painting,
drawing,painting,poor 3D,poor photo,amateur,
bad,weird,distorted,malformed,broken,error,wrong,dirty,unclean,
poor drawing picture,poor drawing line,
dirty drawing,dirty painting,dirty drawing line,
unclean drawing,unclean painting,unclean drawing line,
********
Steps: 20, Sampler: DDIM, CFG scale: 7, Seed: 3502842231, Size: 704x704, Model hash: d0522d12, Denoising strength: 1, Mask blur: 4