Skip to content

Commit

Permalink
Added image-to-image diffusers pipeline (#8318)
Browse files Browse the repository at this point in the history
* fix in external.py

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
  • Loading branch information
cswamy and gradio-pr-bot committed May 17, 2024
1 parent 1f9a5f0 commit 9e31697
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/few-pillows-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gradio": minor
---

feat:Added image-to-image diffusers pipeline
14 changes: 14 additions & 0 deletions gradio/external.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,20 @@ def custom_post_binary(data):
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}")

Expand Down

0 comments on commit 9e31697

Please sign in to comment.