Update image_transformation.py
Browse files- image_transformation.py +5 -3
image_transformation.py
CHANGED
|
@@ -11,8 +11,7 @@ if is_accelerate_available():
|
|
| 11 |
from accelerate import PartialState
|
| 12 |
|
| 13 |
IMAGE_TRANSFORMATION_DESCRIPTION = (
|
| 14 |
-
"This is a tool that transforms an image according to a prompt
|
| 15 |
-
"the image to transform, and `prompt`, which should be the prompt to use to change it. It returns the "
|
| 16 |
"modified image."
|
| 17 |
)
|
| 18 |
|
|
@@ -21,7 +20,10 @@ class ImageTransformationTool(Tool):
|
|
| 21 |
name = "image_transformation"
|
| 22 |
default_stable_diffusion_checkpoint = "timbrooks/instruct-pix2pix"
|
| 23 |
description = IMAGE_TRANSFORMATION_DESCRIPTION
|
| 24 |
-
inputs = {
|
|
|
|
|
|
|
|
|
|
| 25 |
output_type = Image.Image
|
| 26 |
|
| 27 |
def __init__(self, device=None, controlnet=None, stable_diffusion=None, **hub_kwargs) -> None:
|
|
|
|
| 11 |
from accelerate import PartialState
|
| 12 |
|
| 13 |
IMAGE_TRANSFORMATION_DESCRIPTION = (
|
| 14 |
+
"This is a tool that transforms an image according to a prompt and returns the "
|
|
|
|
| 15 |
"modified image."
|
| 16 |
)
|
| 17 |
|
|
|
|
| 20 |
name = "image_transformation"
|
| 21 |
default_stable_diffusion_checkpoint = "timbrooks/instruct-pix2pix"
|
| 22 |
description = IMAGE_TRANSFORMATION_DESCRIPTION
|
| 23 |
+
inputs = {
|
| 24 |
+
'image': {"type": Image.Image, "description": "the image to transform"},
|
| 25 |
+
'prompt': {"type": str, "description": "the prompt to use to change the image"}
|
| 26 |
+
}
|
| 27 |
output_type = Image.Image
|
| 28 |
|
| 29 |
def __init__(self, device=None, controlnet=None, stable_diffusion=None, **hub_kwargs) -> None:
|