{"id":31177749,"url":"https://github.com/vlvink/latent-diffusion-core","last_synced_at":"2026-05-07T13:05:01.035Z","repository":{"id":314656601,"uuid":"1052060321","full_name":"vlvink/latent-diffusion-core","owner":"vlvink","description":"Minimal latent diffusion (mini Stable Diffusion) implementation in PyTorch — VAE, U-Net with cross-attention, fast samplers, and text-to-image generation.","archived":false,"fork":false,"pushed_at":"2025-09-13T20:34:48.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-13T22:21:04.100Z","etag":null,"topics":["diffusion-models","image-generation","latent-diffusion","machine-learning","pytorch","research","stable-diffusion","text-to-image","variational-autoencoder"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vlvink.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-07T10:17:50.000Z","updated_at":"2025-09-13T20:34:51.000Z","dependencies_parsed_at":"2025-09-13T22:32:07.049Z","dependency_job_id":null,"html_url":"https://github.com/vlvink/latent-diffusion-core","commit_stats":null,"previous_names":["vlvink/latent-diffusion-core"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/vlvink/latent-diffusion-core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlvink%2Flatent-diffusion-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlvink%2Flatent-diffusion-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlvink%2Flatent-diffusion-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlvink%2Flatent-diffusion-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vlvink","download_url":"https://codeload.github.com/vlvink/latent-diffusion-core/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlvink%2Flatent-diffusion-core/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275951151,"owners_count":25558395,"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","status":"online","status_checked_at":"2025-09-19T02:00:09.700Z","response_time":108,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["diffusion-models","image-generation","latent-diffusion","machine-learning","pytorch","research","stable-diffusion","text-to-image","variational-autoencoder"],"created_at":"2025-09-19T14:07:39.836Z","updated_at":"2025-09-19T14:07:44.387Z","avatar_url":"https://github.com/vlvink.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eLatent Diffusion Core\u003c/h1\u003e\n\u003c/div\u003e\n\nThe repository contains a minimal implementation of the latent diffusion model (mini Stable Diffusion) on PyTorch.\n\n## Project Description\n\nThis project demonstrates:\n- Training Variational Autoencoder (VAE) to compress images into a compact latent space.\n- Training a U-Net denoizer in this latent space using a diffusion process.\n- Using a text encoder (CLIP) and cross-attention to generate images based on text prompts.\n- Support for fast samplers (DDIM/PNDM) and classifier-free guidance.\n\nThe final goal is to generate 256×256 images based on a text query with a quality approaching Stable Diffusion.\n\n## Installation\nTo run this project, you'll need to set up a Python environment and install the necessary dependencies.\n\n### Prerequisites\nMake sure you have Python 3.11 installed.\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/vlvink/latent_diffusion_core.git\ncd latent_diffusion_core\n```\n\n2. Install the requirements\n```bash\npoetry install\n```\n\n3. Setting the poetry environment\n```bash\npoetry shell\n```\n\n### Dataset downloading\n```bash\ncurl -L -o ./data/coco-2017-dataset.zip \\\n  https://www.kaggle.com/api/v1/datasets/download/awsaf49/coco-2017-dataset\n\nunzip -o ./data/coco-2017-dataset.zip -d ./data\nmv ./data/coco2017/* ./data/\nrmdir ./data/coco2017\n\nrm ./data/coco-2017-dataset.zip\n```\n\n## Running the Code\n### Training VAE\n```bash\npython train_vae.py \\\n  --epochs 50 \\\n  --batch-size 64\n```\n\n### Training Diffusion Model\n```bash\npython train_diffusion.py \\\n  --epochs 200 \\\n  --batch-size 32 \\\n  --text-encoder clip-vit\n```\n\n### Image Generation\n```bash\npython sampling.py \\\n  --prompt \"A futuristic cityscape at sunset\" \\\n  --steps 50 \\\n  --guidance-scale 7.5 \\\n  --output out.png\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvlvink%2Flatent-diffusion-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvlvink%2Flatent-diffusion-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvlvink%2Flatent-diffusion-core/lists"}