m-ric HF staff commited on
Commit
00ef2b0
1 Parent(s): d6713bd

Update image_transformation.py

Browse files
Files changed (1) hide show
  1. 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": 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:
30
  if not is_accelerate_available():
@@ -51,7 +51,7 @@ class ImageTransformationTool(Tool):
51
 
52
  self.is_initialized = True
53
 
54
- def __call__(self, image, prompt):
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