Skip to main content

เริ่มต้นใช้งาน: AUTOMATIC1111's WebGUI

https://github.com/AUTOMATIC1111/stable-diffusion-webui

Installation Guide


https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Dependencies


Config แนะนำก่อนเริ่มใช้งาน


เพิ่ม SD VAE และอื่น ๆ ไว้ด้านบน

image.png

ไปที่ Settings > user interface ดูในส่วน quicksettings list เพิ่ม

sd_model_checkpoint,sd_vae,sd_hypernetworksd_hypernetwork,CLIP_stop_at_last_layers

หรืออื่น ๆ ที่ต้องการใช้ลงไป

image.png


Xformers


https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Xformers

Xformers เป็น library ที่ช่วยในการเร่งความเร็วตอน generate ภาพ ใช้ได้กับการ์ดจอฝั่ง NVIDIA พวก Pascal, Turing, Ampere, Lovelace หรือ Hopper 

Install xformers

หาไฟล์ launch.py เปิดด้วย notepad

หาคำว่า commandline แล้วใส่ --xformers เพิ่มเข้าไป

image.png

เปิดรัน webui-user.bat ได้เลย

ถ้า error เช่น

image.png

หมายถึง version PyTorch ไม่ตรง ให้เปิด webui-user.bat แล้วเพิ่มคำสั่ง ลงไปเพือบังคับอัพเดท PyTorch

 --reinstall-torch --xformers

image.png

Note


สำหรับเครื่อง vram น้อยเช่น 1660super 6GB

เวลาใช้งานอาจเจอ cuda out of memory ให้เปิดไฟล์ webui-user.bat แล้วเพิ่ม

set PYTORCH_CUDA_ALLOC_CONF=garbage_collection_threshold:0.6,max_split_size_mb:128

image.png

Extension


มีไว้เพื่อช่วยให้ workflow สะดวกขึ้น

Extension ทั้งหมดดูได้จาก link ด้านล่าง ติดตั้งได้ผ่านเมนู Extensions ในโปรแกรม โดยดูที่ tab Available กด Load from

https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Extensions


Image Browser

https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Extensions-UI#image-browser


https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Extensions-UI#prompt-gallery


seed travel

https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Extensions-Generation#seed-travel


Kohya-ss Additional Networks

https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Extensions-Generation#kohya-ss-additional-networks

Models


อ่านได้ที่ ความรู้ทั่วไปเกี่ยวกับ Model

Best Practice


สำหรับคนคอมไม่แรง
  • เพื่อความเร็วในการ generate ภาพแนะนำให้ปิด Hires. fix ไปเลยในขั้นตอนแรก
  • generate ภาพ 512*512 ขึ้นมาก่อนแล้วเลือกที่ชอบเก็บไว้
  • โยนภาพที่ชอบลงไปใน PNG Info แล้ว Send to img2img เพื่อนำไปขยาย
  • ดูส่วน Script และเลือก SD upscale
  • เลือก Upscaler ตามชอบใจ ถ้าไม่ได้ลงอะไรต่างหากแนะนำ SwinIR 4x
  • Denoise strength เหลือแถว 0.3
  • Upscaler ดูรายละเอียด link ด้านล่าง

https://www.reddit.com/r/StableDiffusion/comments/xkjjf9/upscale_to_huge_sizes_and_add_detail_with_sd/

Generating a hi res image with hi res fixes, first generates the full image in latent space and then extends that latent representation to a higher resolution through segmentation. This means the latent representation can end up "bent" and therefore while there is no artificating it can look different from the base 512x512.

Lastly, using an upscaler just takes your completed image and passes it through an autoencoder like esrgan that is meant to only increase resolution with no other modifications. Therefore the result is almost 1:1 whatever the lower resolution image is.

In terms of quality. Hi res fix will generate the most natural high resolution image, but if you just want to convert your 512 to 1024 or 4k an upscaler will do it without hassle.