Teriks / dgenerate

dgenerate is a command line tool for generating images and animation sequences using stable diffusion and related techniques.
https://dgenerate.readthedocs.io
20 stars 0 forks source link

adapt a model #4

Open rahmirtrt opened 2 months ago

rahmirtrt commented 2 months ago

How can I adapt a model from spandrel to dgenerate? Which lines, which files should I delete and add? Can you tell me or help me?

for example: How do I add this model to dgenerate? https://github.com/chaiNNer-org/spandrel/tree/main/libs/spandrel/spandrel/architectures/SAFMNBCIE

Teriks commented 2 months ago

If they have not made a release with this architecture present, you can try installing spandrel directly from their main branch into the environment that dgenerate is using, this might work if you have installed dgenerate manually into a virtual environment. It will not work for the windows installer.

You might need to install Git For Windows to use this pip feature

pip install git+https://github.com/chaiNNer-org/spandrel

rahmirtrt commented 2 months ago

I did pip install git+https://github.com/chaiNNer-org/spandrel

Then I manually moved the files from https://github.com/chaiNNer-org/spandrel or C:\Program Files\Python311\Lib\site-packages\libs\spandrel spandrel to C:\Program Files\dgenerate_internal\spandrel folder. I could not run the SAFMNBCIE model in dgenerate.

Teriks commented 2 months ago

It will not work for the windows installer environment, for your usage I would suggest not using the installer and instead installing dgenerate into a virtual environment

for instance

# create environment

python -m venv dgenerate_env

# activate environment, must be done every time before running dgenerate

dgenerate_env\Scripts\activate

pip install dgenerate --extra-index-url https://download.pytorch.org/whl/cu121/
pip install git+https://github.com/chaiNNer-org/spandrel
Teriks commented 2 months ago

You may need to install the additional software mentioned by https://github.com/Teriks/dgenerate?tab=readme-ov-file#manual-install

Such as rust, etc, if pip installing dgenerate produces errors