想輕鬆玩 AI 繪圖,用 iPhone 就能一鍵生成!(教學)

電腦王阿達

132

發佈時間: 2023-03-05 11:35

更新時間: 2023-03-06 04:32

最近 AI 繪圖相當流行,這些其實 Stable Diffusion 這個 AI 繪圖工具所產生的。不過對於沒有太多時間研究、想用 iPhone 輕鬆玩一下打發時間的懶人們來說,這次要與各位分享這個透過瀏覽器搭配 Google Colab 雲端服務,能在 iPhone 、Android 手機、平板、電腦等裝置簡易一鍵生成圖片的方式。

想輕鬆玩 AI 繪圖,用 iPhone 就能一鍵生成!(教學)

這次筆者分享使用 iPhone 來操作一鍵生成 AI 繪圖的懶人技巧(電腦版操作教學可參考阿達文章),首先使用 Chrome 瀏覽器輸入網址:「https://colab.research.google.com/」,接著需登入 Google 帳號才能進入下一步。


再來點擊畫面右上角的「連線」,此時會出現正在連線訊息,最後會出現「已連線」狀態並顯示 RAM與磁碟資訊。


點選 RAM 與磁碟的位置後,將畫面轉到下方的「變更執行階段類型」,把原本硬體加速器改為「GPU」後,點選「儲存」按鈕。


再來回到原本的 Colab 頁面,找到畫面左上角的「+」按鈕,找到對話框貼上安裝指令(指令參考如下)。

貼上以下安裝指令,並點選按鈕開始安裝步驟:

!pip install --upgrade fastapi==0.90.0
!git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
!git clone https://github.com/yfszzx/stable-diffusion-webui-images-browser /content/stable-diffusion-webui/extensions/stable-diffusion-webui-images-browser
!curl -Lo chilloutmixni.safetensors https://huggingface.co/nolanaatama/chomni/resolve/main/chomni.safetensors
!curl -Lo ulzzang-6500.pt https://huggingface.co/nolanaatama/chomni/resolve/main/ulzzang-6500.pt
!curl -Lo koreanDollLikeness_v10.safetensors https://huggingface.co/duthanhduoc/chilloutmix-set/resolve/main/koreanDollLikeness_v10.safetensors
!mkdir /content/stable-diffusion-webui/models/Lora
!mv "/content/koreanDollLikeness_v10.safetensors" "/content/stable-diffusion-webui/models/Lora"
!mv "/content/chilloutmixni.safetensors" "/content/stable-diffusion-webui/models/Stable-diffusion"
!mv "/content/ulzzang-6500.pt" "/content/stable-diffusion-webui/embeddings"
%cd /content/stable-diffusion-webui
!git checkout 91c8d0d
!COMMANDLINE_ARGS="--share --disable-safe-unpickle --no-half-vae --xformers --reinstall-xformers --enable-insecure-extension-access" REQS_FILE="requirements.txt" python launch.py

接著等待一段時間安裝,直到出現了這網址就表示安裝完成了。此時點選該網址即可打開 Stable Diffusion 網頁。此時畫面上會看到上下兩個說明框,上方的「Prompt」表示希望算出來的圖長什麼樣子,而「Negative prompt」則表示不希望算出來的圖片有什麼樣子。下方也會分享建議參數給初次接觸想嘗試的新手。

Prompt 參數參考(請將以下參數貼在 Prompt 欄位):

(8k, RAW photo, best quality, masterpiece:1.2), (realistic, photo-realistic:1.37), ultra-detailed,full body,1 girl, solo,beautiful detailed sky,detailed tokyo street,night,beautiful detailed eyes,beautiful detailed lips,professional lighting, photon mapping, radiosity, physically-based rendering,extremely detailed eyes and face, beautiful detailed eyes,light on face,cinematic lighting, short jacket,hoodie,school uniform,1girl,full body,full-body shot,see-through,looking at viewer,outdoors,

Negative Prompt 參數參考(請將以下參數貼在 Negative Prompt 欄位):

EasyNegative, paintings, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, glans,extra fingers,fewer fingers,strange fingers,bad hand,signature, watermark, username, blurry, bad feet,bad leg, duplicate, extra limb, ugly, disgusting, poorly drawn hands, missing limb, floating limbs, disconnected limbs, malformed hands, blurry,mutated hands and fingers,, EasyNegative, paintings, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, glans,extra fingers,fewer fingers,strange fingers,bad hand,signature, watermark, username, blurry, bad feet,bad leg

將參數貼上後,用戶也能在頁面下方進一步調整其他參數設定,各位也能參照下圖的方式進行調整。另外,如果想調整生成的圖片大小,可以在這裡先調整 Width(寬度)、Height(高度)。


參數設定完後,點選「Generate」就會開始生成圖片。等待一小段時間,圖片就完成囉!這時只要長按就能將完成的圖片儲存下來。


按照上方的參數建議,產生的結果參考:


有時候算出來的圖片不會直接顯示在頁面下方位置,此時我們只要前往「Image Browser」點選「First Page」按鈕,就可以看到剛剛所有算過的圖片。


接著也簡單分享一下引用 LoRA 擴充模型試試成果,操作方式基本相同,只要修改一下參數重新生成圖片即可(下方也會附上參數建議)。

Prompt 參數參考(請將以下參數貼在 Prompt 欄位):

,best quality ,masterpiece, illustration, an extremely delicate and beautiful, extremely detailed ,CG ,unity ,8k wallpaper, Amazing, finely detail, masterpiece,best quality,official art,extremely detailed CG unity 8k wallpaper,absurdres, incredibly absurdres, huge filesize , ultra-detailed, highres, extremely detailed,beautiful detailed girl, extremely detailed eyes and face, beautiful detailed eyes,light on face,(Hanfu:1.1),1girl

Negative Prompt 參數參考(請將以下參數貼在 Negative Prompt 欄位):

sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, bad anatomy,(long hair:1.4),DeepNegative,(fat:1.2),facing away, looking away,tilted head, {Multiple people}, lowres,bad anatomy,bad hands, text, error, missing fingers,extra digit, fewer digits, cropped, worstquality, low quality, normal quality,jpegartifacts,signature, watermark, username,blurry,bad feet,cropped,poorly drawn hands,poorly drawn face,mutation,deformed,worst quality,low quality,normal quality,jpeg artifacts,signature,watermark,extra fingers,fewer digits,extra limbs,extra arms,extra legs,malformed limbs,fused fingers,too many fingers,long neck,cross-eyed,mutated hands,polar lowres,bad body,bad proportions,gross proportions,text,error,missing fingers,missing arms,missing legs,extra digit, extra arms, extra leg, extra foot,

以上述參數算出的成果參考如下:

*小提醒:
由於我們使用的 Google Colab 是免費的,所以圖片只會保存幾小時,連這個主機網址也會在不使用一段時間後失效,所以要存的話動作要快(也能付費訂閱支持一下 Google)。
這些真人模型大都是以現實存在的人物為範本,你算了自己看著爽沒什麼問題。但只要「商用」(如:當作產品宣傳海報、開 OnlyFans 等商業行為),則非常有可能被告。畢竟不管哪個國家的經紀公司都不希望自己的藝人肖像被濫用,更何況有以假亂真的問題,大家自己要注意一下。

[embed]https://www.kocpc.com.tw/archives/482754[/embed]

資料來源想輕鬆玩 AI 繪圖,用 iPhone 就能一鍵生成!(教學)
若針對此內容有任何建議,請聯繫客服