lysandre HF staff commited on
Commit
661eb08
1 Parent(s): bd76182

Update image_transformation.py (#2)

Browse files

- Update image_transformation.py (10397afcc44c4bd7a9699f142a38273294486bc5)
- Requirements (d6e268b14b8043d7ad26ebdc242db0e6be6a1a18)

Files changed (2) hide show
  1. image_transformation.py +1 -6
  2. requirements.txt +1 -1
image_transformation.py CHANGED
@@ -5,18 +5,15 @@ import torch
5
  from transformers.tools.base import Tool, get_default_device
6
  from transformers.utils import (
7
  is_accelerate_available,
8
- is_diffusers_available,
9
  is_vision_available,
10
  is_opencv_available,
11
  )
 
12
 
13
 
14
  if is_vision_available():
15
  from PIL import Image
16
 
17
- if is_diffusers_available():
18
- from diffusers import StableDiffusionControlNetPipeline, ControlNetModel, UniPCMultistepScheduler
19
-
20
  if is_opencv_available():
21
  import cv2
22
 
@@ -39,8 +36,6 @@ class ControlNetTransformationTool(Tool):
39
  def __init__(self, device=None, controlnet=None, stable_diffusion=None, **hub_kwargs) -> None:
40
  if not is_accelerate_available():
41
  raise ImportError("Accelerate should be installed in order to use tools.")
42
- if not is_diffusers_available():
43
- raise ImportError("Diffusers should be installed in order to use the StableDiffusionTool.")
44
  if not is_vision_available():
45
  raise ImportError("Pillow should be installed in order to use the StableDiffusionTool.")
46
 
 
5
  from transformers.tools.base import Tool, get_default_device
6
  from transformers.utils import (
7
  is_accelerate_available,
 
8
  is_vision_available,
9
  is_opencv_available,
10
  )
11
+ from diffusers import StableDiffusionControlNetPipeline, ControlNetModel, UniPCMultistepScheduler
12
 
13
 
14
  if is_vision_available():
15
  from PIL import Image
16
 
 
 
 
17
  if is_opencv_available():
18
  import cv2
19
 
 
36
  def __init__(self, device=None, controlnet=None, stable_diffusion=None, **hub_kwargs) -> None:
37
  if not is_accelerate_available():
38
  raise ImportError("Accelerate should be installed in order to use tools.")
 
 
39
  if not is_vision_available():
40
  raise ImportError("Pillow should be installed in order to use the StableDiffusionTool.")
41
 
requirements.txt CHANGED
@@ -1,4 +1,4 @@
1
- transformers @ git+https://github.com/huggingface/transformers@test_composition
2
  diffusers
3
  accelerate
4
  opencv-python
 
1
+ transformers
2
  diffusers
3
  accelerate
4
  opencv-python