{"id":16378755,"url":"https://github.com/stability-ai/sd3-ref","last_synced_at":"2025-04-28T16:12:21.288Z","repository":{"id":244097452,"uuid":"814256441","full_name":"Stability-AI/sd3-ref","owner":"Stability-AI","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-16T20:38:05.000Z","size":25,"stargazers_count":102,"open_issues_count":2,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-28T16:12:15.249Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Stability-AI.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}},"created_at":"2024-06-12T16:33:49.000Z","updated_at":"2025-04-22T04:40:44.000Z","dependencies_parsed_at":"2024-06-12T23:02:38.997Z","dependency_job_id":"c36dd763-ae3c-4c20-a7e2-58aa2bce6810","html_url":"https://github.com/Stability-AI/sd3-ref","commit_stats":null,"previous_names":["mcmonkey4eva/sd3-ref","stability-ai/sd3-ref"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stability-AI%2Fsd3-ref","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stability-AI%2Fsd3-ref/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stability-AI%2Fsd3-ref/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stability-AI%2Fsd3-ref/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Stability-AI","download_url":"https://codeload.github.com/Stability-AI/sd3-ref/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251342725,"owners_count":21574245,"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":[],"created_at":"2024-10-11T03:46:24.632Z","updated_at":"2025-04-28T16:12:21.260Z","avatar_url":"https://github.com/Stability-AI.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stable Diffusion 3 Micro-Reference Implementation\n\nInference-only tiny reference implementation of SD3.\n\nContains code for the text encoders (OpenAI CLIP-L/14, OpenCLIP bigG, Google T5-XXL) (these models are all public), the VAE Decoder (similar to previous SD models, but 16-channels and no postquantconv step), and the core MM-DiT (entirely new).\n\nEverything you need to inference SD3 excluding the weights files.\n\nNote: this repo is an early reference lib meant to assist partner organizations in implementing SD3. For normal inference, use [Comfy](https://github.com/comfyanonymous/ComfyUI) or UIs based on it such as [Swarm](https://github.com/Stability-AI/StableSwarmUI).\n\n### Install\n\n```sh\n# Note: on windows use \"python\" not \"python3\"\npython3 -s -m venv venv\nsource ./venv/bin/activate\n# or on windows: venv/scripts/activate\npython3 -s -m pip install -r requirements.txt\n```\n\n### Test Usage\n\n```sh\n# Generate a cat on ref model with default settings\npython3 -s sd3_infer.py\n# Generate a 1024 cat on SD3-8B\npython3 -s sd3_infer.py --width 1024 --height 1024 --shift 3 --model models/sd3_medium.safetensors --prompt \"cute wallpaper art of a cat\"\n# Or for parameter listing\npython3 -s sd3_infer.py --help\n```\n\nImages will be output to `output.png` by default\n\n### File Guide\n\n- `sd3_infer.py` - entry point, review this for basic usage of diffusion model and the triple-tenc cat\n- `sd3_impls.py` - contains the wrapper around the MMDiT and the VAE\n- `other_impls.py` - contains the CLIP model, the T5 model, and some utilities\n- `mmdit.py` - contains the core of the MMDiT itself\n- folder `models` with the following files (download separately):\n    - `clip_g.safetensors` (openclip bigG, same as SDXL, can grab a public copy)\n    - `clip_l.safetensors` (OpenAI CLIP-L, same as SDXL, can grab a public copy)\n    - `t5xxl.safetensors` (google T5-v1.1-XXL, can grab a public copy)\n    - `sd3_medium.safetensors` (or whichever main MMDiT model file)\n\n### Code Origin\n\nThe code included here originates from:\n- Stability AI internal research code repository (MM-DiT)\n- Public Stability AI repositories (eg VAE)\n- Some unique code for this reference repo written by Alex Goodwin for Stability AI\n- Some code from ComfyUI internal Stability impl of SD3 (for some code corrections and handlers)\n- HuggingFace and upstream providers (for sections of CLIP/T5 code)\n\n### Legal\n\nMIT License\n\nCopyright (c) 2024 Stability AI\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n#### Note\n\nSome code in `other_impls` originates from HuggingFace and is subject to [the HuggingFace Transformers Apache2 License](https://github.com/huggingface/transformers/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstability-ai%2Fsd3-ref","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstability-ai%2Fsd3-ref","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstability-ai%2Fsd3-ref/lists"}