Skip to main content

Stable Diffusion

Getting Started

AUTOMATIC1111's WebGUI

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

Installation Guide

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

 

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

image.png

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

sd_model_checkpoint,sd_vae,sd_hypernetwork

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

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


Best

UpscalePractice

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

    ด้านล่าง คือร่างเฉย ๆ ยังทำไม่เสร็จ

    Textual Inversion

    GUI

    ใช้ build-in

    https://book.biribiri.me/books/735b9/page/stable-diffusion-textual-inversion-training

     https://github.com/bmaltais/kohya_ss.git

    Colab

    https://colab.research.google.com/github/TheLastBen/fast-stable-diffusion/blob/main/fast_stable_diffusion_AUTOMATIC1111.ipynb#scrollTo=CFWtw-6EPrKi



    LoRA

    GUI

     https://github.com/bmaltais/kohya_ss.git

    progressive learning rates: 0.05:10, 0.02:20, 0.01:60, 0.005:200, 0.002:500, 0.001:3000, 0.0005


    Colab

    https://github.com/cloneofsimo/lora