66
77from  diffusers  import  EulerDiscreteScheduler , StableDiffusionInstructPix2PixPipeline , StableDiffusionPipeline 
88from  diffusers .loaders .single_file_utils  import  _extract_repo_id_and_weights_name 
9+ from  diffusers .utils  import  load_image 
910from  diffusers .utils .testing_utils  import  (
1011    backend_empty_cache ,
1112    enable_full_determinism ,
13+     nightly ,
1214    require_torch_accelerator ,
1315    slow ,
1416    torch_device ,
@@ -120,6 +122,7 @@ def test_single_file_format_inference_is_same_as_pretrained(self):
120122        super ().test_single_file_format_inference_is_same_as_pretrained (expected_max_diff = 1e-3 )
121123
122124
125+ @nightly  
123126@slow  
124127@require_torch_accelerator  
125128class  StableDiffusionInstructPix2PixPipelineSingleFileSlowTests (unittest .TestCase , SDSingleFileTesterMixin ):
@@ -142,12 +145,16 @@ def tearDown(self):
142145
143146    def  get_inputs (self , device , generator_device = "cpu" , dtype = torch .float32 , seed = 0 ):
144147        generator  =  torch .Generator (device = generator_device ).manual_seed (seed )
148+         image  =  load_image (
149+             "https://huggingface.co/datasets/diffusers/test-arrays/resolve/main/stable_diffusion_pix2pix/example.jpg" 
150+         )
145151        inputs  =  {
146-             "prompt" : "a fantasy landscape, concept art, high resolution" ,
152+             "prompt" : "turn him into a cyborg" ,
153+             "image" : image ,
147154            "generator" : generator ,
148-             "num_inference_steps" : 2 ,
149-             "strength" : 0.75 ,
155+             "num_inference_steps" : 3 ,
150156            "guidance_scale" : 7.5 ,
157+             "image_guidance_scale" : 1.0 ,
151158            "output_type" : "np" ,
152159        }
153160        return  inputs 
0 commit comments