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: Support sdxl-turbo #816

Merged
merged 2 commits into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions xinference/model/image/model_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
"model_id": "stabilityai/sd-turbo",
"model_revision": "1681ed09e0cff58eeb41e878a49893228b78b94c"
},
{
"model_name": "sdxl-turbo",
"model_family": "stable_diffusion",
"model_id": "stabilityai/sdxl-turbo",
"model_revision": "f4b0486b498f84668e828044de1d0c8ba486e05b"
},
{
"model_name": "stable-diffusion-v1.5",
"model_family": "stable_diffusion",
Expand Down
8 changes: 6 additions & 2 deletions xinference/model/image/tests/test_stable_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,19 @@ def test_restful_api_for_image_with_mlsd_controlnet(setup):
logger.info("test result %s", r)


def test_restful_api_for_sd_turbo(setup):
@pytest.mark.parametrize("model_name", ["sd-turbo", "sdxl-turbo"])
def test_restful_api_for_sd_turbo(setup, model_name):
if model_name == "sdxl-turbo":
pytest.skip("sdxl-turbo cost too many resources.")

endpoint, _ = setup
from ....client import Client

client = Client(endpoint)

model_uid = client.launch_model(
model_uid="my_controlnet",
model_name="sd-turbo",
model_name=model_name,
model_type="image",
)
model = client.get_model(model_uid)
Expand Down
Loading