MCPcopy Create free account
hub / github.com/TencentARC/BrushNet / __init__

Method __init__

src/diffusers/image_processor.py:66–83  ·  view source on GitHub ↗
(
        self,
        do_resize: bool = True,
        vae_scale_factor: int = 8,
        resample: str = "lanczos",
        do_normalize: bool = True,
        do_binarize: bool = False,
        do_convert_rgb: bool = False,
        do_convert_grayscale: bool = False,
    )

Source from the content-addressed store, hash-verified

64
65 @register_to_config
66 def __init__(
67 self,
68 do_resize: bool = True,
69 vae_scale_factor: int = 8,
70 resample: str = "lanczos",
71 do_normalize: bool = True,
72 do_binarize: bool = False,
73 do_convert_rgb: bool = False,
74 do_convert_grayscale: bool = False,
75 ):
76 super().__init__()
77 if do_convert_rgb and do_convert_grayscale:
78 raise ValueError(
79 "`do_convert_rgb` and `do_convert_grayscale` can not both be set to `True`,"
80 " if you intended to convert the image into RGB format, please set `do_convert_grayscale = False`.",
81 " if you intended to convert the image into grayscale format, please set `do_convert_rgb = False`",
82 )
83 self.config.do_convert_rgb = False
84
85 @staticmethod
86 def numpy_to_pil(images: np.ndarray) -> List[PIL.Image.Image]:

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected