Update image_transformation.py
Browse files- image_transformation.py +4 -4
image_transformation.py
CHANGED
@@ -21,10 +21,10 @@ class ImageTransformationTool(Tool):
|
|
21 |
default_stable_diffusion_checkpoint = "timbrooks/instruct-pix2pix"
|
22 |
description = IMAGE_TRANSFORMATION_DESCRIPTION
|
23 |
inputs = {
|
24 |
-
'image': {"type":
|
25 |
-
'prompt': {"type":
|
26 |
}
|
27 |
-
output_type =
|
28 |
|
29 |
def __init__(self, device=None, controlnet=None, stable_diffusion=None, **hub_kwargs) -> None:
|
30 |
if not is_accelerate_available():
|
@@ -51,7 +51,7 @@ class ImageTransformationTool(Tool):
|
|
51 |
|
52 |
self.is_initialized = True
|
53 |
|
54 |
-
def
|
55 |
if not self.is_initialized:
|
56 |
self.setup()
|
57 |
|
|
|
21 |
default_stable_diffusion_checkpoint = "timbrooks/instruct-pix2pix"
|
22 |
description = IMAGE_TRANSFORMATION_DESCRIPTION
|
23 |
inputs = {
|
24 |
+
'image': {"type": "image", "description": "the image to transform"},
|
25 |
+
'prompt': {"type": "string", "description": "the prompt to use to change the image"}
|
26 |
}
|
27 |
+
output_type = "image"
|
28 |
|
29 |
def __init__(self, device=None, controlnet=None, stable_diffusion=None, **hub_kwargs) -> None:
|
30 |
if not is_accelerate_available():
|
|
|
51 |
|
52 |
self.is_initialized = True
|
53 |
|
54 |
+
def forward(self, image, prompt):
|
55 |
if not self.is_initialized:
|
56 |
self.setup()
|
57 |
|