Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(runner): add support for SDXL-Lightning in image-to-image pipelines #40

Merged
merged 3 commits into from
Mar 15, 2024

Conversation

rickstaa
Copy link
Collaborator

@rickstaa rickstaa commented Mar 14, 2024

This pull request adds the SDXL-Lightning model to the image-to-image pipelines.

Fixes LIV-97

@@ -37,8 +48,49 @@ def __init__(self, model_id: str):
kwargs["variant"] = "fp16"

self.model_id = model_id
self.ldm = AutoPipelineForImage2Image.from_pretrained(model_id, **kwargs)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made some minor changes here. First, I combine the pipeline initialization and GPU allocation steps in one line. Moreover, I've transitioned to using torch_device variable.

@rickstaa rickstaa requested a review from yondonfu March 14, 2024 21:36
@@ -164,6 +164,24 @@ def text_to_image_sdxl_lightning_8step_api():
return make_api("text-to-image", "ByteDance/SDXL-Lightning-8step")


@stub.function(image=api_image, secrets=[Secret.from_name("api-auth-token")])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Starter plan for Modal only supports 8 deployed endpoints so as-is I think deploying this app would fail. Assuming that is the case, I would recommend removing the following endpoints to stay under the limit:

  • image_to_video_svd_api() -> can just use the SVD1.1 endpoint

Copy link
Collaborator Author

@rickstaa rickstaa Mar 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I noticed that error yesterday when I deployed a test endpoint to my modal account. I have now commented out the SVD1.0 endpoint in 7334b3a 👍🏻. We can remove it if we agree with the more fixed 6FPS and Motion Bucket Id 127 hyperparameters on which the SVD1.1 was trained.

This commit comments out the
`stabilityai/stable-video-diffusion-img2vid-xt` function to adhere to
modal.com's starter plan which only includes 8 deployed endpoints.
@yondonfu yondonfu merged commit 5ba5c6b into main Mar 15, 2024
1 check passed
@yondonfu yondonfu deleted the add_LIV-97 branch March 15, 2024 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants