From 0dd6fd661adba22b61340b511b0cd2f1353a111b Mon Sep 17 00:00:00 2001 From: atandra2000 Date: Tue, 2 Jun 2026 13:35:31 +0530 Subject: [PATCH] chore: add MIT License, CITATION.cff, .env.example, expand .gitignore --- .env.example | 11 +++++++++++ .gitignore | 46 ++++++++++++++++++++++++++++++++++++++++++++-- CITATION.cff | 39 +++++++++++++++++++++++++++++++++++++++ LICENSE | 21 +++++++++++++++++++++ 4 files changed, 115 insertions(+), 2 deletions(-) create mode 100644 .env.example create mode 100644 CITATION.cff create mode 100644 LICENSE diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..f4c29b3 --- /dev/null +++ b/.env.example @@ -0,0 +1,11 @@ +# Hugging Face Hub (write scope) — used by scripts/download_checkpoint.py and +# any local fine-tune resume helpers that pull/push from atandra2000/sd-from-scratch-v1. +HF_TOKEN= + +# Weights & Biases — used by SD_Train.py for training-time monitoring. +WANDB_API_KEY= + +# Optional: override paths if you don't use the defaults +# CHECKPOINT_DIR=./checkpoints +# LATENT_DIR=./laion_latents +# HF_HOME=./.hf-cache diff --git a/.gitignore b/.gitignore index 219766f..cfae5ba 100644 --- a/.gitignore +++ b/.gitignore @@ -1,18 +1,37 @@ +# Python __pycache__/ *.pyc *.pyo +*.pyd .Python *.egg-info/ dist/ build/ +.pytest_cache/ +.ruff_cache/ +.mypy_cache/ +.coverage +htmlcov/ + +# Virtual environments .env +.env.local +.env.*.local .venv venv/ +diffusion/ + +# Secrets (defensive — never commit raw token files) +secrets/ +*.pem +*.key # Checkpoints and model weights *.pt *.pth +*.ckpt *.safetensors +*.bin checkpoints/ outputs/ @@ -21,13 +40,29 @@ outputs/ *.parquet *.tar *.zip +*.tgz +*.h5 +*.hdf5 +*.arrow +*.lance laion_*/ +vggface_*/ +coco_*/ +dm_*/ +p7_*/ /workspace/ -# Training logs and wandb +# HF/HuggingFace caches +.hf-cache/ +.cache/huggingface/ + +# Training logs and W&B *.log +logs/ wandb/ training.log +runs/ +tb_logs/ # Generated images (exclude training validation grids, keep curated samples) val_epoch_*.png @@ -35,13 +70,20 @@ results/*.png !results/samples/ !results/samples/*.png !assets/*.png +!docs/images/ # Jupyter .ipynb_checkpoints/ *.ipynb -# IDE +# IDE / editor .idea/ .vscode/ *.swp +*.swo +*~ + +# OS .DS_Store +Thumbs.db +desktop.ini diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000..389ecf9 --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,39 @@ +cff-version: 1.2.0 +title: "Stable Diffusion from Scratch (SD-From-Scratch v1)" +message: "If you use this software or the released checkpoint, please cite it as below." +type: software +authors: + - given-names: Atandra + family-names: Bharati + email: atandrabharati@gmail.com +repository-code: "https://github.com/atandra2000/StableDiffusion" +url: "https://github.com/atandra2000/StableDiffusion" +abstract: >- + A Stable Diffusion 1.x-class latent diffusion model implemented and + trained entirely from scratch in PyTorch on 2× RTX 5090 (Blackwell) GPUs. + Provides the full UNet (~860M params), DDPM/DDIM schedulers, LAION data + pipeline, dual-GPU latent encoding, DDP+BF16 training loop, and + CUDA/MPS inference. Released checkpoint sd_epoch_042.pt is hosted on + Hugging Face Hub at atandra2000/sd-from-scratch-v1. +license: MIT +version: "1.0.0" +date-released: 2026-06-02 +keywords: + - stable-diffusion + - latent-diffusion + - diffusion-models + - pytorch + - text-to-image + - generative-ai + - from-scratch + - rtx-5090 + - blackwell + - ddp +preferred-citation: + type: software + authors: + - given-names: Atandra + family-names: Bharati + title: "SD-From-Scratch v1: A Stable-Diffusion-class latent diffusion model trained from scratch on dual RTX 5090s" + year: 2026 + url: "https://huggingface.co/atandra2000/sd-from-scratch-v1" diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e2862a0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Atandra Bharati + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.