disco-diffusion icon indicating copy to clipboard operation
disco-diffusion copied to clipboard

refactoring for increased modularity

Open dmarx opened this issue 2 years ago • 3 comments

One of my main goals with PyTTI is to develop a library that facilitates building generative art colabs. towards that end, I'm hoping to use DD as a target to try to see what "implemented on top of PyTTI" might look like. My main goal with this refactor is to better understand what components of disco are really DD specific, vs what parts might be more general purpose. My opinion is that generally useful stuff should be modularized as much as possible to facilitate reuse, and moreover that the notebooks themselves should really just be a UI with the code that "does stuff" moved to a separate backend codebase, model-view-controller paradigm for colab notebooks.

Enough preamble. Here are a few of the major changes:

  • Updated some dependencies to be installed to reduce namespace collisions and eliminate need for changing directory for imports
  • moved a bunch of code into modules, which required moving some variables into call signatures that otherwise were being invoked from the global namespace

dmarx avatar Feb 28 '22 19:02 dmarx

NB: as of this writing, testing has basically been limited to making sure the modified notebook here runs. Also be advised: the notebook in this branch currently clones from this dev repo/branch, which will need to be changed prior to a merge if y'all are inclined to incorporate any of this

dmarx avatar Feb 28 '22 19:02 dmarx

Oh yeah also a general tip: pip install -e isn't always supported. Better to just use pip install. I think that's why taming or CLIP wasn't being installed correctly, for example. some discussion here: https://github.com/pypa/pip/issues/7265

dmarx avatar Feb 28 '22 19:02 dmarx

@GraphtyLove NB: this PR was suggested 5 months ago and has been stale since then. If this refactor is something you're interested in incorporating, it will take some additional work to apply these changes to the current code base.

dmarx avatar Jul 17 '22 04:07 dmarx