mirror of
https://github.com/gradio-app/gradio.git
synced 2024-11-27 01:40:20 +08:00
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:
parent
1f9a5f0aa3
commit
9e31697d94
5
.changeset/few-pillows-leave.md
Normal file
5
.changeset/few-pillows-leave.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"gradio": minor
|
||||
---
|
||||
|
||||
feat:Added image-to-image diffusers pipeline
|
@ -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}")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user