Added image-to-image diffusers pipeline (#8318)

* fix in external.py

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
cswamy 2024-05-17 21:57:05 +01:00 committed by GitHub
parent 1f9a5f0aa3
commit 9e31697d94
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
"gradio": minor
---
feat:Added image-to-image diffusers pipeline

View File

@ -348,6 +348,20 @@ def from_model(model_name: str, hf_token: str | None, alias: str | None, **kwarg
inputs = components.Image(type="filepath", label="Input Image")
outputs = components.AnnotatedImage(label="Annotations")
fn = external_utils.object_detection_wrapper(client)
# example model: stabilityai/stable-diffusion-xl-refiner-1.0
elif p == "image-to-image":
inputs = [
components.Image(type="filepath", label="Input Image"),
components.Textbox(label="Input"),
]
outputs = components.Image(label="Output")
examples = [
[
"https://gradio-builds.s3.amazonaws.com/demo-files/cheetah-002.jpg",
"Photo of a cheetah with green eyes",
]
]
fn = client.image_to_image
else:
raise ValueError(f"Unsupported pipeline type: {p}")