Advertisement
Guest User

Stable Diffusion Face Animations

a guest
Oct 10th, 2022
5,035
2
Never
5
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 2 0
  1. = Animate Your Stable Diffusion Faces! =
  2.  
  3. Notes:
  4. * Github - https://github.com/yoyo-nb/Thin-Plate-Spline-Motion-Model
  5. * Uses PyTorch so can work on Nvidia, AMD or CPU - https://pytorch.org/get-started/locally/
  6. * Includes Google Colab & Huggingface links - run via your web browser!
  7. * You'll need a "driving video" - such as recording yourself on your own webcam!
  8. * You'll also need a cool avatar!
  9.  
  10.  
  11. == New virtual environment ==
  12. conda create --name thin-plate-spline python=3.9
  13. conda activate thin-plate-spline
  14.  
  15. == Download ==
  16. git clone https://github.com/yoyo-nb/Thin-Plate-Spline-Motion-Model.git
  17. cd Thin-Plate-Spline-Motion-Model
  18. mkdir checkpoints
  19.  
  20. * Download the pre-trained models (mgif.pth.tar, etc) into your newly created checkpoints directory
  21. * You'll only need the vox one for faces
  22.  
  23.  
  24. == Edit ==
  25. Edit the requirements.txt file to remove torchvision & torch and set Pillow==9.2.0 because of nerdy reasons
  26.  
  27. == Install requirements ===
  28. * Now we can install the latest PyTorch with CUDA 11 support # nerdy reasons
  29. pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116
  30. pip install -r requirements.txt
  31.  
  32. == Run ==
  33. * Example custom generation with best frame detection:
  34. CUDA_VISIBLE_DEVICES=0 python demo.py --config config/vox-256.yaml \
  35. --checkpoint checkpoints/vox.pth.tar --source_image assets/SD_Avatar.png \
  36. --driving_video assets/Video_good_example.mp4 --find_best_frame --result_video SD_Avatar_Video.mp4
  37.  
  38. * Example 2:
  39. CUDA_VISIBLE_DEVICES=0 python demo.py --config config/vox-256.yaml \
  40. --checkpoint checkpoints/vox.pth.tar --source_image assets/SD_Avatar.png \
  41. --driving_video assets/Video_bad_example.mp4 --find_best_frame --result_video SD_Avatar_Video_bad.mp4
  42.  
  43.  
Advertisement
Comments
  • verte71
    2 years
    # text 1.22 KB | 0 0
    1. Hi i need a help,
    2. not sure what I'm doing wrong but keep getting below error:
    3. (thin-plate-spline) PS C:\Users\krzys\Thin-Plate-Spline-Motion-Model> CUDA_VISIBLE_DEVICES=0 python demo.py --config config/vox-256.yaml \
    4. >> --checkpoint checkpoints/vox.pth.tar --source_image assets/jp2.jpg \
    5. >> --driving_video assets/jp2.mp4 --find_best_frame --result_video SD_Avatar_Video.mp4
    6. At line:2 char:4
    7. + --checkpoint checkpoints/vox.pth.tar --source_image assets/jp2.jpg \
    8. + ~
    9. Missing expression after unary operator '--'.
    10. At line:2 char:4
    11. + --checkpoint checkpoints/vox.pth.tar --source_image assets/jp2.jpg \
    12. + ~~~~~~~~~~
    13. Unexpected token 'checkpoint' in expression or statement.
    14. At line:3 char:4
    15. + --driving_video assets/jp2.mp4 --find_best_frame --result_video SD_A ...
    16. + ~
    17. Missing expression after unary operator '--'.
    18. At line:3 char:4
    19. + --driving_video assets/jp2.mp4 --find_best_frame --result_video SD_A ...
    20. + ~~~~~~~~~~~~~
    21. Unexpected token 'driving_video' in expression or statement.
    22. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
    23. + FullyQualifiedErrorId : MissingExpressionAfterOperator
    24.  
    25. (thin-plate-spline) PS C:\Users\krzys\Thin-Plate-Spline-Motion-Model>
  • Litefeather
    2 years
    Comment was deleted
  • IC4zen
    2 years
    # text 0.41 KB | 0 0
    1. using anaconda, running demo line, getting:
    2. 'CUDA_VISIBLE_DEVICES' is not recognized as an internal or external command,
    3.  
    4. so, removed this from the front (set ENV in a separate line), getting:
    5. import lzma
    6. File "C:\Users\the_i\.conda\envs\thin-plate-spline\lib\lzma.py", line 27, in <module>
    7. from _lzma import *
    8. ImportError: DLL load failed while importing _lzma: The specified module could not be found.
Add Comment
Please, Sign In to add comment
Advertisement