{"id":22492515,"url":"https://github.com/garystafford/svdxt-sagemaker-huggingface","last_synced_at":"2025-08-03T00:31:24.273Z","repository":{"id":234618339,"uuid":"789253591","full_name":"garystafford/svdxt-sagemaker-huggingface","owner":"garystafford","description":"Deploy and invoke Stability AI's Stable Video Diffusion XT (SVT-XT) 1.1 foundation model on Amazon SageMaker.","archived":false,"fork":false,"pushed_at":"2024-05-18T12:07:26.000Z","size":93710,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-18T13:24:45.109Z","etag":null,"topics":["amazon-sagemaker","aws","generative-ai","stability-ai","stable-video-diffusion"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/garystafford.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}},"created_at":"2024-04-20T03:33:08.000Z","updated_at":"2024-05-18T13:24:46.665Z","dependencies_parsed_at":"2024-05-18T13:34:51.598Z","dependency_job_id":null,"html_url":"https://github.com/garystafford/svdxt-sagemaker-huggingface","commit_stats":null,"previous_names":["garystafford/svd-sm-hf","garystafford/svdxt-sagemaker-huggingface"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garystafford%2Fsvdxt-sagemaker-huggingface","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garystafford%2Fsvdxt-sagemaker-huggingface/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garystafford%2Fsvdxt-sagemaker-huggingface/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garystafford%2Fsvdxt-sagemaker-huggingface/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/garystafford","download_url":"https://codeload.github.com/garystafford/svdxt-sagemaker-huggingface/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228508014,"owners_count":17931263,"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":["amazon-sagemaker","aws","generative-ai","stability-ai","stable-video-diffusion"],"created_at":"2024-12-06T18:18:39.068Z","updated_at":"2024-12-06T18:18:39.804Z","avatar_url":"https://github.com/garystafford.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stable Video Diffusion XT 1.1 on Amazon SageMaker\n\nStability AI's [Stable Video Diffusion XT (SVT-XT) 1.1](https://stability.ai/stable-video) foundation model, available on [Hugging Face](https://huggingface.co/stabilityai/stable-video-diffusion-img2vid-xt-1-1), is a diffusion model that takes in a still image as a conditioning frame and generates a short 4 second video. The notebook walks through configuring, creating, and invoking an [Asynchronous Inference Endpoint](https://docs.aws.amazon.com/sagemaker/latest/dg/async-inference.html) backed by the SVT-XT foundation model on Amazon SageMaker.\n\nFor more information on using this repository, read the associated blog post, [Generative AI Videos with Stability AI’s Stable Video Diffusion XT using Asynchronous Inference on Amazon SageMaker](https://garystafford.medium.com/generative-ai-videos-with-stability-ais-stable-video-diffusion-xt-using-asynchronous-inference-on-6810e0a7cab6).\n\n## Notebook Versions\n\n- **Public URL for Conditioning Image**: Version 1 of the Notebook, [svd_xt_demo_v1.ipynb](svd_xt_demo_v1.ipynb), passes a publicly accessible URL of the image in the request payload used to invoke the model. Use the corresponding custom inference script, [inference_v1/inference.py](inference_v1/inference.py).\n\n- **Conditioning Image Passed in Request Payload**: Version 2 of the Notebook, [svd_xt_demo_v2.ipynb](svd_xt_demo_v2.ipynb), passes an encoded image in the request payload used to invoke the model. Use the corresponding custom inference script, [inference_v2/inference.py](inference_v2/inference.py).\n\n## Architecture for Version 1: Public URL for Conditioning Image\n\n![Architecture V1](architecture/async_inference_v1.png)\n\n## Architecture for Version 2: Conditioning Image Passed in Request Payload\n\n![Architecture V2](architecture/async_inference_v2.png)\n\n## Streamlit Application\n\nThe project now includes an interactive Streamlit application to generate the videos. Make sure you have first installed the required Python packages, as outlined in the [Optional: Local Development Environment](https://github.com/garystafford/svdxt-sagemaker-huggingface?tab=readme-ov-file#optional-local-development-environment) section, below. The application can be started with the following command:\n\n```sh\nstreamlit run app.py --server.runOnSave true\n```\n\n![Streamlit App](architecture/stremalit_app.png)\n\n## Wide-format Videos\n\nAll videos created using Notebook included in this project.\n\n\u003ctable\u003e\n   \u003ctr\u003e\n      \u003ctd\u003e\u003cimg src=\"video_samples/rocket_1.gif\" alt=\"Rocket\" width=\"615\"/\u003e\n      \u003c/br\u003e\u003ca href=\"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/svd/rocket.png\"\u003eSource image\u003c/a\u003e\u003c/td\u003e\n   \u003c/tr\u003e\n   \u003ctr\u003e\n      \u003ctd\u003e\u003cimg src=\"video_samples/red_car_1.gif\" alt=\"Red Sports Car\" width=\"615\"/\u003e\n      \u003c/br\u003e\u003ca href=\"https://www.pexels.com/photo/red-alfa-romeo-c4-on-road-near-trees-210019\"\u003eSource image\u003c/a\u003e\u003c/td\u003e\n   \u003c/tr\u003e\n   \u003ctr\u003e\n      \u003ctd\u003e\u003cimg src=\"video_samples/beach_bike_2.gif\" alt=\"Motorcycle on Beach\" width=\"615\"/\u003e\n      \u003c/br\u003e\u003ca href=\"https://www.pexels.com/photo/photo-of-man-riding-bicycle-4054069\"\u003eSource image\u003c/a\u003e\u003c/td\u003e\n   \u003c/tr\u003e\n   \u003ctr\u003e\n      \u003ctd\u003e\u003cimg src=\"video_samples/koi_2.gif\" alt=\"Koi\" width=\"615\"/\u003e\n      \u003c/br\u003e\u003ca href=\"https://unsplash.com/photos/two-koi-fish-swimming-DpI3yVVeJyA\"\u003eSource image\u003c/a\u003e\u003c/td\u003e\n   \u003c/tr\u003e\n   \u003ctr\u003e\n      \u003ctd\u003e\u003cimg src=\"video_samples/waterfall_2.gif\" alt=\"Tropical Waterfall\" width=\"615\"/\u003e\n      \u003c/br\u003e\u003ca href=\"https://www.pexels.com/photo/time-lapse-photography-of-waterfall-2406388\"\u003eSource image\u003c/a\u003e\u003c/td\u003e\n   \u003c/tr\u003e\n   \u003ctr\u003e\n      \u003ctd\u003e\u003cimg src=\"video_samples/boat_ocean_1.gif\" alt=\"Boat on Shore\" width=\"615\"/\u003e\n      \u003c/br\u003e\u003ca href=\"https://www.pexels.com/photo/seinboat-sunrise-20544112\"\u003eSource image\u003c/a\u003e\u003c/td\u003e\n   \u003c/tr\u003e\n   \u003ctr\u003e\n      \u003ctd\u003e\u003cimg src=\"video_samples/false_gods_1_pingpong.gif\" alt=\"AI\" width=\"615\"/\u003e\n      \u003c/br\u003eSource image generated with Stable Diffusion XL (SDXL) 1.0\u003c/a\u003e\u003c/td\u003e\n   \u003c/tr\u003e\n\u003c/table\u003e\n\n## Tall-format Videos\n\nAll videos created using Notebook included in this project.\n\n\u003ctable\u003e\n   \u003ctr\u003e\n      \u003ctd\u003e\u003cimg src=\"video_samples/coffee_1.gif\" alt=\"Turkish Coffee\" width=\"346\"/\u003e\n      \u003c/br\u003e\u003ca href=\"https://www.pexels.com/photo/a-shot-of-steaming-pot-with-a-and-glass-with-a-beverage-10351409\"\u003eSource image\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003cimg src=\"video_samples/champagne_2.gif\" alt=\"Champagne\" width=\"346\"/\u003e\n      \u003c/br\u003e\u003ca href=\"https://www.pexels.com/photo/close-up-of-beer-glass-against-black-background-255483\"\u003eSource image\u003c/a\u003e\u003c/td\u003e\n   \u003c/tr\u003e\n   \u003ctr\u003e\n      \u003ctd\u003e\u003cimg src=\"video_samples/color_smoke_tall_1.gif\" alt=\"Colored Smoke\" width=\"346\"/\u003e\n      \u003c/br\u003e\u003ca href=\"https://www.pexels.com/photo/red-smoke-illustration-604671\"\u003eSource image\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003cimg src=\"video_samples/smoke_tall_1.gif\" alt=\"Smoke\" width=\"346\"/\u003e\n      \u003c/br\u003e\u003ca href=\"https://www.pexels.com/photo/close-up-of-beer-glass-against-black-background-255483\"\u003eSource image\u003c/a\u003e\u003c/td\u003e\n   \u003c/tr\u003e\n\u003c/table\u003e\n\n## Optional: Local Development Environment\n\nSetup local environment to modify project.\n\n```sh\npython3 -m pip install virtualenv -Uq\nvirtualenv svd-venv\npython3 -m venv svd-venv\n\nsource svd-venv/bin/activate\n```\n\n```sh\npython3 -m pip install -r local_requirements.txt -Uq\n```\n\n## References\n\n- \u003chttps://github.com/aws-samples/amazon-sagemaker-asynchronous-inference-computer-vision/blob/main/mask-rcnn-async-inference.ipynb\u003e\n- \u003chttps://github.com/huggingface/diffusers/issues/6956\u003e\n- \u003chttps://github.com/huggingface/notebooks/blob/main/sagemaker/23_stable_diffusion_inference/sagemaker-notebook.ipynb\u003e\n- \u003chttps://github.com/philschmid/huggingface-inferentia2-samples/blob/main/stable-diffusion-xl/sagemaker-notebook.ipynb\u003e\n- \u003chttps://github.com/Stability-AI/generative-models/blob/main/scripts/sampling/simple_video_sample.py\u003e\n- \u003chttps://huggingface.co/docs/diffusers/en/using-diffusers/svd\u003e\n- \u003chttps://huggingface.co/docs/sagemaker/inference#create-a-model-artifact-for-deployment\u003e\n- \u003chttps://huggingface.co/stabilityai/stable-video-diffusion-img2vid-xt/tree/main\u003e\n- \u003chttps://sagemaker.readthedocs.io/en/stable/api/inference/async_inference.html\u003e\n- \u003chttps://www.philschmid.de/sagemaker-stable-diffusion\u003e\n\n---\n\n_The contents of this repository represent my viewpoints and not of my past or current employers, including Amazon Web Services (AWS). All third-party libraries, modules, plugins, and SDKs are the property of their respective owners._\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarystafford%2Fsvdxt-sagemaker-huggingface","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgarystafford%2Fsvdxt-sagemaker-huggingface","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarystafford%2Fsvdxt-sagemaker-huggingface/lists"}