Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -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
46 changes: 44 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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/

Expand All @@ -21,27 +40,50 @@ 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
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
39 changes: 39 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -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"
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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.
Loading