Stable Diffusion 101 : Extension : AnimateDiff
Stable Diffusion 101 : Extension : AnimateDiff
มันเป็น Extension แบบ Text to Video นั่นเอง ผ่าน Automate1111
วิธีการทำงานของมันคือ มันมี Model (Motion Module) ที่ผ่านการ Train จาก Clip วิดีโอขนาดเล็กจำนวนมาก และเหมือน Extension ของ ControlNet คือ มันสามารถใช้งานร่วมกับ Checkpoint ได้ตั้งแต่ เวอร์ชั่น 1.5 ขึ้นไป
อย่างไรก็ดี มันมีการเปลี่ยน Checkpoint Model ระหว่าง สร้าง Clip เรียกเทคนิกนี้ว่า Prompt Travel และควบคุม Video ผ่าน ControlNet
Install
1. Install AnimateDiff Extension ไปที่ Extension tabs แล้ว install จาก URL คือ
1.1 https://github.com/continue-revolution/sd-webui-animatediff
1.2 ดาวน์โหลด Motion Module ที่
https://huggingface.co/conrevo/AnimateDiff-A1111/blob/main/motion_module/mm_sd15_v3.safetensors
เอาไปวางที่โฟลเดอร์
stable-diffusion-webui > extensions > sd-webui-animatediff > model.
2. Install บางอย่างลงใน Windows (ความจริงแล้วมันไม่จำเป็นมากนัก)
2.1 ffmpeg: https://www.ffmpeg.org/download.html
2.2 T2I adapter: https://github.com/TencentARC/T2I-Adapter/tree/SD
2.3 gifsicle ด้วยการ pip install https://github.com/kohler/gifsicle
Generation
ขั้นตอน 1-3 จะตั้งค่าเหมือนกับ txt2img ทั่วไป
1. เลือก Checkpoint Model
2. เขียน Prompt และ Negative Prompt
3. ตั้งค่าที่เหลือเหมือนกับ Generate ภาพทั่วไปก่อน
ขั้นตอนที่ 4 เป็นต้นไปจะเป็น AnimateDiff
4. Motion Module: mm_sd_v15_v3.ckpt
5. Enable AnimateDiff: Yes
6. Number of frames: 32 (This is the length of the video)
7. FPS: 8 (This is frame per second. So the video length is 32 frames / 8 fps = 4 secs)
8. Save แล้วแต่ฟอร์แมทไฟล์ที่คุณเลือก แต่แนะนำเป็น mp4
9. Generate
สำหรับ Advance
ถ้าเราเลือก
Film และ InterP x เป็น 5 (ของเก่าเราเลือก 8 เฟรมไว้ มันจะ x 5 เป็น 40 เฟรมต่อวินาทีทำให้ภาพสมูทขึ้น)
ถ้าเราเลือก
Context Batch
ยิ่งเลือกมาก สิ่งของยิ่งขยับน้อย แต่ข้อดีคือ มันจะสมูทกว่า เช่น 32 แทบจะไม่ขยับเลย
และถ้าเราเปิด ControlNet ด้วย (เราแนะนำให้ใช้ CannyEdge และ OpenPose จะ work กว่า)
หรือ เราสามารถ เพิ่ม LoRA Motion เข้าไปก็ได้ (ทำเหมือน txt2Img เลย)
Prompt Travel
คือการระบุเวลาเข้าไปใน Prompt ด้วย ยกตัวอย่างเช่น
(masterpiece, top quality, best quality, official art, beautiful and aesthetic:1.2), (1girl), extreme detailed,(fractal art:1.3),colorful,highest detailed
0: smile
8: (arm over head:1.2)
studio lighting
ความคิดเห็น
แสดงความคิดเห็น