Stable Diffusion is an A.I. image generator model released in August 2022 that immediately catalysed a burst of open source forks, some packaged as notebooks rather than traditional Python packages for ease of mass usage. The deforum notebook was released with an initial v0.1 and I immediately set out to refactor it into a form that could be run locally as an 'editable' Python package.
This was a fun exercise in software refactoring that found quite a large audience of likeminded users as soon as I published it to GitHub.
The style of the notebook code was a bit unusual to me, but mostly I left the underlying logic untouched. The main benefit of packaging was to factor out the code from a single glorified 'God module' program into small readable (thus more maintainable) modules, however the original project is also exemplary of how having enough 'eyes' on a project can serve to 'test it'.
From v0.1 several iterations were committed to the deforum fork which I then rolled into the refactored repo.
While I initially 'rolled my own' method of recording prompts within the image (using piexif), the open source community has since standardised a method of 'invisible watermarking'.
Work to follow the notebook's updates from v0.1 to v0.4 is underway, and turns out to require further dependencies not packaged but instead simply appended to the path. This therefore requires them to be packaged up (as I'd prefer not to bloat the repo too much by stuffing it full of dependencies).