{"id":23155652,"url":"https://github.com/bentoml/BentoDiffusion","last_synced_at":"2025-08-17T23:32:11.014Z","repository":{"id":189922710,"uuid":"652780999","full_name":"bentoml/BentoDiffusion","owner":"bentoml","description":"BentoDiffusion: A collection of diffusion models served with BentoML","archived":false,"fork":false,"pushed_at":"2025-04-29T16:42:13.000Z","size":7937,"stargazers_count":374,"open_issues_count":11,"forks_count":29,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-08-16T09:00:36.065Z","etag":null,"topics":["ai","diffusion-models","fine-tuning","kubernetes","lora","model-serving","stable-diffusion"],"latest_commit_sha":null,"homepage":"https://bentoml.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bentoml.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-06-12T19:33:53.000Z","updated_at":"2025-08-02T22:17:27.000Z","dependencies_parsed_at":"2023-08-22T12:29:22.622Z","dependency_job_id":"7caa21e8-529e-4863-834e-b5a5ec5c411f","html_url":"https://github.com/bentoml/BentoDiffusion","commit_stats":null,"previous_names":["bentoml/onediffusion","bentoml/bentodiffusion"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bentoml/BentoDiffusion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bentoml%2FBentoDiffusion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bentoml%2FBentoDiffusion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bentoml%2FBentoDiffusion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bentoml%2FBentoDiffusion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bentoml","download_url":"https://codeload.github.com/bentoml/BentoDiffusion/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bentoml%2FBentoDiffusion/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270922509,"owners_count":24668567,"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-08-17T02:00:09.016Z","response_time":129,"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":["ai","diffusion-models","fine-tuning","kubernetes","lora","model-serving","stable-diffusion"],"created_at":"2024-12-17T21:10:52.836Z","updated_at":"2025-08-17T23:32:11.002Z","avatar_url":"https://github.com/bentoml.png","language":"Python","readme":"\u003cdiv align=\"center\"\u003e\n    \u003ch1 align=\"center\"\u003eSelf-host Diffusion Models with BentoML\u003c/h1\u003e\n\u003c/div\u003e\n\nThis repository contains a series of BentoML example projects, demonstrating how to deploy different models in [the Stable Diffusion (SD) family](https://huggingface.co/models?other=stable-diffusion), which is specialized in generating and manipulating images or video clips based on text prompts.\n\nSee [here](https://docs.bentoml.com/en/latest/examples/overview.html) for a full list of BentoML example projects.\n\nThe following guide uses SDXL Turbo as an example.\n\n## Prerequisites\n\nIf you want to test the Service locally, we recommend you use an Nvidia GPU with at least 12GB VRAM.\n\n## Install dependencies\n\n```bash\ngit clone https://github.com/bentoml/BentoDiffusion.git\ncd BentoDiffusion/sdxl-turbo\n\n# Recommend Python 3.11\npip install -r requirements.txt\n```\n\n## Run the BentoML Service\n\nWe have defined a BentoML Service in `service.py`. Run `bentoml serve` in your project directory to start the Service.\n\n```bash\n$ bentoml serve\n\n2024-01-18T18:31:49+0800 [INFO] [cli] Starting production HTTP BentoServer from \"service:SDXLTurboService\" listening on http://localhost:3000 (Press CTRL+C to quit)\nLoading pipeline components...: 100%\n```\n\nThe server is now active at [http://localhost:3000](http://localhost:3000/). You can interact with it using the Swagger UI or in other different ways.\n\nCURL\n\n```bash\ncurl -X 'POST' \\\n  'http://localhost:3000/txt2img' \\\n  -H 'accept: image/*' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n  \"prompt\": \"A cinematic shot of a baby racoon wearing an intricate italian priest robe.\",\n  \"num_inference_steps\": 1,\n  \"guidance_scale\": 0\n}'\n```\n\nPython client\n\n```python\nimport bentoml\n\nwith bentoml.SyncHTTPClient(\"http://localhost:3000\") as client:\n        result = client.txt2img(\n            prompt=\"A cinematic shot of a baby racoon wearing an intricate italian priest robe.\",\n            num_inference_steps=1,\n            guidance_scale=0.0\n        )\n```\n\nFor detailed explanations of the Service code, see [Stable Diffusion XL Turbo](https://docs.bentoml.com/en/latest/use-cases/diffusion-models/sdxl-turbo.html).\n\n## Deploy to BentoCloud\n\nAfter the Service is ready, you can deploy the application to BentoCloud for better management and scalability. [Sign up](https://www.bentoml.com/) if you haven't got a BentoCloud account.\n\nMake sure you have [logged in to BentoCloud](https://docs.bentoml.com/en/latest/scale-with-bentocloud/manage-api-tokens.html).\n\n```bash\nbentoml cloud login\n```\n\nDeploy it to BentoCloud.\n\n```bash\nbentoml deploy\n```\n\nOnce the application is up and running on BentoCloud, you can access it via the exposed URL.\n\n**Note**: For custom deployment in your own infrastructure, use [BentoML to generate an OCI-compliant image](https://docs.bentoml.com/en/latest/get-started/packaging-for-deployment.html).\n\n\n## Choose another diffusion model\n\nTo deploy a different diffusion model, go to the corresponding subdirectories of this repository.\n\n- [FLUX.1](flux-timestep-distilled/)\n- [Stable Diffusion 3 Medium](sd3-medium/)\n- [Stable Diffusion 3.5 Large Turbo](sd3.5-large-turbo/)\n- [Stable Diffusion 3.5 Large](sd3.5-large/)\n- [Stable Diffusion XL Lightning](sdxl-lightning/)\n- [Stable Diffusion XL Turbo](sdxl-turbo/)\n- [ControlNet](controlnet/)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbentoml%2FBentoDiffusion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbentoml%2FBentoDiffusion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbentoml%2FBentoDiffusion/lists"}