micwalk / blender-export-diffusion

Export blender camera animations to Deforum Diffusion notebook format.
MIT License
64 stars 3 forks source link

blender-export-diffusion

A Blender Add-on to add an export format that generates animation strings for the Deforum Diffusion notebook format. Ability to select a range of frames to export, multiple cameras, and does a basic pass at not including redundant keyframes.

Note: only supports 3d animation mode.

Deforum Notebook GH: https://github.com/deforum/stable-diffusion Deforum Notebook Colab: https://colab.research.google.com/github/deforum/stable-diffusion/blob/main/Deforum_Stable_Diffusion.ipynb

Installation

Download/clone the repo, or just the file export_diffusion.py. In Blender go to Edit > Preferences > Add-ons, click Install and select the export_diffusion.py file. You should then see a new add-on in the list called "Export Camera Animation to Diffusion Notebook String". Click the checkbox to enable. There should now be a new entry under File > Export > Diffusion Notebook String.

Export Settings

Usage Notes

After exporting, open the text file. All exported cameras will have their own block of strings. The strings are designed as python code you can copy/paste as a block into the notebook animation section.

For best results, set your Blender framerate and frame counts to match your notebook settings. For more rapid testing, this animation preview notebook is great: https://colab.research.google.com/github/pharmapsychotic/ai-notebooks/blob/main/pharmapsychotic_AnimationPreview.ipynb

Author & License

MIT license. Written by Michael Walker micwalk@gmail.com Twitter: @mwalk10