@@ -47,6 +47,8 @@ def download_diffusers_config(repo_id, tmpdir):
4747
4848
4949class  SDSingleFileTesterMixin :
50+     single_file_kwargs  =  {}
51+ 
5052    def  _compare_component_configs (self , pipe , single_file_pipe ):
5153        for  param_name , param_value  in  single_file_pipe .text_encoder .config .to_dict ().items ():
5254            if  param_name  in  ["torch_dtype" , "architectures" , "_name_or_path" ]:
@@ -154,7 +156,7 @@ def test_single_file_components_with_original_config_local_files_only(
154156        self ._compare_component_configs (pipe , single_file_pipe )
155157
156158    def  test_single_file_format_inference_is_same_as_pretrained (self , expected_max_diff = 1e-4 ):
157-         sf_pipe  =  self .pipeline_class .from_single_file (self .ckpt_path , safety_checker = None )
159+         sf_pipe  =  self .pipeline_class .from_single_file (self .ckpt_path , safety_checker = None ,  ** self . single_file_kwargs )
158160        sf_pipe .unet .set_attn_processor (AttnProcessor ())
159161        sf_pipe .enable_model_cpu_offload (device = torch_device )
160162
@@ -170,7 +172,7 @@ def test_single_file_format_inference_is_same_as_pretrained(self, expected_max_d
170172
171173        max_diff  =  numpy_cosine_similarity_distance (image .flatten (), image_single_file .flatten ())
172174
173-         assert  max_diff  <  expected_max_diff 
175+         assert  max_diff  <  expected_max_diff ,  f" { image . flatten () }  !=  { image_single_file . flatten () } " 
174176
175177    def  test_single_file_components_with_diffusers_config (
176178        self ,
0 commit comments