sample-datasets / text_outputs_single_file /test_stable_diffusion_controlnet_inpaint_single_file_output.txt
sayakpaul's picture
sayakpaul HF staff
Upload folder using huggingface_hub
aa6ad2f verified
raw
history blame
No virus
13.9 kB
============================= test session starts ==============================
platform linux -- Python 3.8.10, pytest-8.2.0, pluggy-1.5.0
rootdir: /diffusers
configfile: pyproject.toml
plugins: xdist-3.6.1, timeout-2.3.1, requests-mock-1.10.0
collected 7 items
tests/single_file/test_stable_diffusion_controlnet_inpaint_single_file.py . [ 14%]
...FF. [100%]
=================================== FAILURES ===================================
_ StableDiffusionControlNetInpaintPipelineSingleFileSlowTests.test_single_file_components_with_original_config _
self = <tests.single_file.test_stable_diffusion_controlnet_inpaint_single_file.StableDiffusionControlNetInpaintPipelineSingleFileSlowTests testMethod=test_single_file_components_with_original_config>
def test_single_file_components_with_original_config(self):
controlnet = ControlNetModel.from_pretrained("lllyasviel/control_v11p_sd15_canny", variant="fp16")
pipe = self.pipeline_class.from_pretrained(self.repo_id, controlnet=controlnet)
pipe_single_file = self.pipeline_class.from_single_file(
self.ckpt_path, controlnet=controlnet, original_config=self.original_config
)
> super()._compare_component_configs(pipe, pipe_single_file)
tests/single_file/test_stable_diffusion_controlnet_inpaint_single_file.py:122:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tests.single_file.test_stable_diffusion_controlnet_inpaint_single_file.StableDiffusionControlNetInpaintPipelineSingleFileSlowTests testMethod=test_single_file_components_with_original_config>
pipe = StableDiffusionControlNetInpaintPipeline {
"_class_name": "StableDiffusionControlNetInpaintPipeline",
"_diffusers_... ],
"unet": [
"diffusers",
"UNet2DConditionModel"
],
"vae": [
"diffusers",
"AutoencoderKL"
]
}
single_file_pipe = StableDiffusionControlNetInpaintPipeline {
"_class_name": "StableDiffusionControlNetInpaintPipeline",
"_diffusers_... ],
"unet": [
"diffusers",
"UNet2DConditionModel"
],
"vae": [
"diffusers",
"AutoencoderKL"
]
}
def _compare_component_configs(self, pipe, single_file_pipe):
for param_name, param_value in single_file_pipe.text_encoder.config.to_dict().items():
if param_name in ["torch_dtype", "architectures", "_name_or_path"]:
continue
assert pipe.text_encoder.config.to_dict()[param_name] == param_value
PARAMS_TO_IGNORE = [
"torch_dtype",
"_name_or_path",
"architectures",
"_use_default_values",
"_diffusers_version",
]
for component_name, component in single_file_pipe.components.items():
if component_name in single_file_pipe._optional_components:
continue
# skip testing transformer based components here
# skip text encoders / safety checkers since they have already been tested
if component_name in ["text_encoder", "tokenizer", "safety_checker", "feature_extractor"]:
continue
assert component_name in pipe.components, f"single file {component_name} not found in pretrained pipeline"
assert isinstance(
component, pipe.components[component_name].__class__
), f"single file {component.__class__.__name__} and pretrained {pipe.components[component_name].__class__.__name__} are not the same"
for param_name, param_value in component.config.items():
if param_name in PARAMS_TO_IGNORE:
continue
# Some pretrained configs will set upcast attention to None
# In single file loading it defaults to the value in the class __init__ which is False
if param_name == "upcast_attention" and pipe.components[component_name].config[param_name] is None:
pipe.components[component_name].config[param_name] = param_value
> assert (
pipe.components[component_name].config[param_name] == param_value
), f"single file {param_name}: {param_value} differs from pretrained {pipe.components[component_name].config[param_name]}"
E AssertionError: single file sample_size: 512 differs from pretrained 256
tests/single_file/single_file_testing_utils.py:85: AssertionError
----------------------------- Captured stderr call -----------------------------
safety_checker/model.safetensors not found
Loading pipeline components...: 0%| | 0/7 [00:00<?, ?it/s]
Loading pipeline components...: 14%|β–ˆβ– | 1/7 [00:00<00:01, 3.93it/s]
Loading pipeline components...: 29%|β–ˆβ–ˆβ–Š | 2/7 [00:00<00:01, 4.50it/s]
Loading pipeline components...: 57%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹ | 4/7 [00:00<00:00, 4.44it/s]
Loading pipeline components...: 71%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ– | 5/7 [00:02<00:01, 1.64it/s]
Loading pipeline components...: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 7/7 [00:02<00:00, 2.94it/s]
Fetching 12 files: 0%| | 0/12 [00:00<?, ?it/s]
Fetching 12 files: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 12/12 [00:00<00:00, 105517.08it/s]
Loading pipeline components...: 0%| | 0/6 [00:00<?, ?it/s]Some weights of the model checkpoint were not used when initializing CLIPTextModel:
['text_model.embeddings.position_ids']
Loading pipeline components...: 50%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ | 3/6 [00:00<00:00, 19.29it/s]
Loading pipeline components...: 83%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž | 5/6 [00:00<00:00, 6.71it/s]
Loading pipeline components...: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 6/6 [00:00<00:00, 8.21it/s]
You have disabled the safety checker for <class 'diffusers.pipelines.controlnet.pipeline_controlnet_inpaint.StableDiffusionControlNetInpaintPipeline'> by passing `safety_checker=None`. Ensure that you abide to the conditions of the Stable Diffusion license and do not expose unfiltered results in services or applications open to the public. Both the diffusers team and Hugging Face strongly recommend to keep the safety filter enabled in all public facing circumstances, disabling it only for use-cases that involve analyzing network behavior or auditing its results. For more information, please have a look at https://github.com/huggingface/diffusers/pull/254 .
_ StableDiffusionControlNetInpaintPipelineSingleFileSlowTests.test_single_file_components_with_original_config_local_files_only _
self = <tests.single_file.test_stable_diffusion_controlnet_inpaint_single_file.StableDiffusionControlNetInpaintPipelineSingleFileSlowTests testMethod=test_single_file_components_with_original_config_local_files_only>
def test_single_file_components_with_original_config_local_files_only(self):
controlnet = ControlNetModel.from_pretrained(
"lllyasviel/control_v11p_sd15_canny", torch_dtype=torch.float16, variant="fp16"
)
pipe = self.pipeline_class.from_pretrained(
self.repo_id,
controlnet=controlnet,
safety_checker=None,
)
with tempfile.TemporaryDirectory() as tmpdir:
ckpt_filename = self.ckpt_path.split("/")[-1]
local_ckpt_path = download_single_file_checkpoint(self.repo_id, ckpt_filename, tmpdir)
local_original_config = download_original_config(self.original_config, tmpdir)
pipe_single_file = self.pipeline_class.from_single_file(
local_ckpt_path,
original_config=local_original_config,
controlnet=controlnet,
safety_checker=None,
local_files_only=True,
)
> super()._compare_component_configs(pipe, pipe_single_file)
tests/single_file/test_stable_diffusion_controlnet_inpaint_single_file.py:146:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tests.single_file.test_stable_diffusion_controlnet_inpaint_single_file.StableDiffusionControlNetInpaintPipelineSingleFileSlowTests testMethod=test_single_file_components_with_original_config_local_files_only>
pipe = StableDiffusionControlNetInpaintPipeline {
"_class_name": "StableDiffusionControlNetInpaintPipeline",
"_diffusers_... ],
"unet": [
"diffusers",
"UNet2DConditionModel"
],
"vae": [
"diffusers",
"AutoencoderKL"
]
}
single_file_pipe = StableDiffusionControlNetInpaintPipeline {
"_class_name": "StableDiffusionControlNetInpaintPipeline",
"_diffusers_... ],
"unet": [
"diffusers",
"UNet2DConditionModel"
],
"vae": [
"diffusers",
"AutoencoderKL"
]
}
def _compare_component_configs(self, pipe, single_file_pipe):
for param_name, param_value in single_file_pipe.text_encoder.config.to_dict().items():
if param_name in ["torch_dtype", "architectures", "_name_or_path"]:
continue
assert pipe.text_encoder.config.to_dict()[param_name] == param_value
PARAMS_TO_IGNORE = [
"torch_dtype",
"_name_or_path",
"architectures",
"_use_default_values",
"_diffusers_version",
]
for component_name, component in single_file_pipe.components.items():
if component_name in single_file_pipe._optional_components:
continue
# skip testing transformer based components here
# skip text encoders / safety checkers since they have already been tested
if component_name in ["text_encoder", "tokenizer", "safety_checker", "feature_extractor"]:
continue
assert component_name in pipe.components, f"single file {component_name} not found in pretrained pipeline"
assert isinstance(
component, pipe.components[component_name].__class__
), f"single file {component.__class__.__name__} and pretrained {pipe.components[component_name].__class__.__name__} are not the same"
for param_name, param_value in component.config.items():
if param_name in PARAMS_TO_IGNORE:
continue
# Some pretrained configs will set upcast attention to None
# In single file loading it defaults to the value in the class __init__ which is False
if param_name == "upcast_attention" and pipe.components[component_name].config[param_name] is None:
pipe.components[component_name].config[param_name] = param_value
> assert (
pipe.components[component_name].config[param_name] == param_value
), f"single file {param_name}: {param_value} differs from pretrained {pipe.components[component_name].config[param_name]}"
E AssertionError: single file sample_size: 512 differs from pretrained 256
tests/single_file/single_file_testing_utils.py:85: AssertionError
----------------------------- Captured stderr call -----------------------------
text_encoder/model.safetensors not found
Loading pipeline components...: 0%| | 0/6 [00:00<?, ?it/s]
Loading pipeline components...: 17%|β–ˆβ–‹ | 1/6 [00:00<00:01, 4.19it/s]
Loading pipeline components...: 33%|β–ˆβ–ˆβ–ˆβ–Ž | 2/6 [00:00<00:00, 4.67it/s]
Loading pipeline components...: 67%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹ | 4/6 [00:01<00:00, 2.04it/s]
Loading pipeline components...: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 6/6 [00:01<00:00, 3.43it/s]
You have disabled the safety checker for <class 'diffusers.pipelines.controlnet.pipeline_controlnet_inpaint.StableDiffusionControlNetInpaintPipeline'> by passing `safety_checker=None`. Ensure that you abide to the conditions of the Stable Diffusion license and do not expose unfiltered results in services or applications open to the public. Both the diffusers team and Hugging Face strongly recommend to keep the safety filter enabled in all public facing circumstances, disabling it only for use-cases that involve analyzing network behavior or auditing its results. For more information, please have a look at https://github.com/huggingface/diffusers/pull/254 .
Loading pipeline components...: 0%| | 0/6 [00:00<?, ?it/s]Some weights of the model checkpoint were not used when initializing CLIPTextModel:
['text_model.embeddings.position_ids']
Loading pipeline components...: 67%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹ | 4/6 [00:00<00:00, 23.42it/s]
Loading pipeline components...: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 6/6 [00:00<00:00, 10.34it/s]
You have disabled the safety checker for <class 'diffusers.pipelines.controlnet.pipeline_controlnet_inpaint.StableDiffusionControlNetInpaintPipeline'> by passing `safety_checker=None`. Ensure that you abide to the conditions of the Stable Diffusion license and do not expose unfiltered results in services or applications open to the public. Both the diffusers team and Hugging Face strongly recommend to keep the safety filter enabled in all public facing circumstances, disabling it only for use-cases that involve analyzing network behavior or auditing its results. For more information, please have a look at https://github.com/huggingface/diffusers/pull/254 .
=========================== short test summary info ============================
FAILED tests/single_file/test_stable_diffusion_controlnet_inpaint_single_file.py::StableDiffusionControlNetInpaintPipelineSingleFileSlowTests::test_single_file_components_with_original_config
FAILED tests/single_file/test_stable_diffusion_controlnet_inpaint_single_file.py::StableDiffusionControlNetInpaintPipelineSingleFileSlowTests::test_single_file_components_with_original_config_local_files_only
=================== 2 failed, 5 passed in 226.26s (0:03:46) ====================