{"id":28047901,"url":"https://github.com/neggles/neurosis","last_synced_at":"2025-05-11T21:55:32.257Z","repository":{"id":184086164,"uuid":"664939479","full_name":"neggles/neurosis","owner":"neggles","description":"a neural network trainer for weebs","archived":false,"fork":false,"pushed_at":"2025-05-05T21:08:58.000Z","size":772,"stargazers_count":13,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-11T21:55:23.628Z","etag":null,"topics":["cursed","diffusers","haunted","python3","pytorch","pytorch-lightning","stable-diffusion","stable-diffusion-xl"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neggles.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-07-11T05:02:09.000Z","updated_at":"2025-03-30T06:52:27.000Z","dependencies_parsed_at":"2023-07-27T02:56:12.818Z","dependency_job_id":"ecd7614b-9cda-4c88-ad7b-cb87513da295","html_url":"https://github.com/neggles/neurosis","commit_stats":null,"previous_names":["neggles/neurosis"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neggles%2Fneurosis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neggles%2Fneurosis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neggles%2Fneurosis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neggles%2Fneurosis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neggles","download_url":"https://codeload.github.com/neggles/neurosis/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253639575,"owners_count":21940446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cursed","diffusers","haunted","python3","pytorch","pytorch-lightning","stable-diffusion","stable-diffusion-xl"],"created_at":"2025-05-11T21:55:31.749Z","updated_at":"2025-05-11T21:55:32.250Z","avatar_url":"https://github.com/neggles.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# neurosis\n\na neural network trainer for ~~weebs~~ diffusion models.\n\n## OwO what's this?\n\nI got sick and tired of trying to trace execution through the arcane codepaths of existing Stable Diffusion trainers, so I wrote my own.\nThis is based off the modeling/training code from [@Stability-AI/generative-models](https://github.com/Stability-AI/generative-models),\nwith *significant* modification for usability and readability.\n\n## Features\n\nMajor changes from `generative-models` include:\n\n- Architectural changes:\n  - Migration to full PyTorch Lightning\n  - LightningCLI trainer interface and configuration management (config file format is largely the same as `generative-models`, but with some minor differences in keywords)\n  - Refactoring of some of the configuration code and model subclassing\n  - \"oops, all wandb\" approach to logging (with some TensorBoard support as well)\n- Trainer changes:\n  - Use of PyTorch Lightning's `Trainer` class for training\n  - Support for multiple GPUs (and multiple nodes, if you're into that)\n  - Support for individual learning rates for the UNet and for each TE module\n  - VAE training support! (kinda! discriminators are iffy but it works mostly)\n- Module changes:\n  - Rework of the `ImageLogger` to... sorta kinda work?\n  - Adding support for `Adafactor` scheduler as well as the usual BitsAndBytes etc. ones\n  - hey look tag frequency based loss scaling wonder where we got that one from :eyes:\n  - Cleanup and refactoring of most modules to make them more readable and easier to trace execution\n  - Probably more duplicated code than there really should be but here we are in this hell timeline\n  - A huge pile of small changes too numerous to mention\n- Dataset handling:\n  - Support for Huggingface datasets (kinda! you're on your own but it should work if the keys match)\n  - Shiny new ImageFolder datasets in \"square\", \"square with captions\", and \"aspect-bucketed with captions\" flavors\n  - Support for custom datasets (see `neurosis/dataset/` for examples)\n  - Funny hybrid mongo+s3 dataset we're using for large-scale training (stop judging me, it works)\n  - Support for custom data transform functions injected into the dataset pipeline[^1]\n\n[^1]: completely untested and not entirely pushed to public yet sry\n\n## Installation\n\nOK so first of all:\n\n1. **Do Not.**\n\nif you REALLY must, here:\n\n```bash\ngit clone https://github.com/neggles/neurosis.git neurosis\ncd neurosis\npython3.10 -m venv .venv\nsource .venv/bin/activate\npython -m pip install -U pip setuptools wheel setuptools-scm\npython -m pip install -e '.[all]'\n```\n\nThere is a docker container in GitHub packages, if you're feeling masochistic today.\n\nWill also be throwing up Kubeflow manifest examples at some point (needs more testing)\n\n## Usage\n\nI am once again asking,\n\n1. Please, *please just **Do Not***\n\nbut if the idea of arguing with my code and trying to figure shit out from incomplete outdated configuration templates\nsounds attractive to you, by all means:\n\n```bash\npython -m neurosis.trainer.cli --help\n```\n\nIf you need more assistance than that, this code is probably not ready for you to use yet.\n\n### If you open an issue without providing liberal amounts of detail, logs, exactly what you tried, and exactly how it broke, you're going to get WONTFIX'd for the time being.\n\nThis will change as/if/when the code gets a bit more stable and usable.\n\n## License\n\nMy own code is GPLv3, see [LICENSE.md](LICENSE.md)\n\nA significant amount of code is copied from from [@Stability-AI/generative-models](https://github.com/Stability-AI/generative-models),which is MIT licensed and has been relicensed here under GPLv3 due to the extensive modifications.\n\nSome code carries its own licenses (most notably LPIPS and Adafactor),\nsee the appropriate SPDX identifiers and LICENSE files in the relevant files' directories.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneggles%2Fneurosis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneggles%2Fneurosis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneggles%2Fneurosis/lists"}