2020import  torch 
2121import  torch .nn  as  nn 
2222from  huggingface_hub  import  hf_hub_download 
23- from  huggingface_hub .repocard  import  RepoCard 
2423from  safetensors .torch  import  load_file 
2524from  transformers  import  CLIPTextModel , CLIPTokenizer 
2625
@@ -103,7 +102,7 @@ def tearDown(self):
103102    @slow  
104103    @require_torch_gpu  
105104    def  test_integration_move_lora_cpu (self ):
106-         path  =  "runwayml /stable-diffusion-v1- 5" 
105+         path  =  "Jiali /stable-diffusion-1. 5" 
107106        lora_id  =  "takuma104/lora-test-text-encoder-lora-target" 
108107
109108        pipe  =  StableDiffusionPipeline .from_pretrained (path , torch_dtype = torch .float16 )
@@ -162,7 +161,7 @@ def test_integration_move_lora_cpu(self):
162161    def  test_integration_move_lora_dora_cpu (self ):
163162        from  peft  import  LoraConfig 
164163
165-         path  =  "Lykon/dreamshaper-8 " 
164+         path  =  "Jiali/stable-diffusion-1.5 " 
166165        unet_lora_config  =  LoraConfig (
167166            init_lora_weights = "gaussian" ,
168167            target_modules = ["to_k" , "to_q" , "to_v" , "to_out.0" ],
@@ -222,7 +221,7 @@ def tearDown(self):
222221        torch .cuda .empty_cache ()
223222
224223    def  test_integration_logits_with_scale (self ):
225-         path  =  "runwayml /stable-diffusion-v1- 5" 
224+         path  =  "Jiali /stable-diffusion-1. 5" 
226225        lora_id  =  "takuma104/lora-test-text-encoder-lora-target" 
227226
228227        pipe  =  StableDiffusionPipeline .from_pretrained (path , torch_dtype = torch .float32 )
@@ -254,7 +253,7 @@ def test_integration_logits_with_scale(self):
254253        release_memory (pipe )
255254
256255    def  test_integration_logits_no_scale (self ):
257-         path  =  "runwayml /stable-diffusion-v1- 5" 
256+         path  =  "Jiali /stable-diffusion-1. 5" 
258257        lora_id  =  "takuma104/lora-test-text-encoder-lora-target" 
259258
260259        pipe  =  StableDiffusionPipeline .from_pretrained (path , torch_dtype = torch .float32 )
@@ -284,8 +283,8 @@ def test_dreambooth_old_format(self):
284283        generator  =  torch .Generator ("cpu" ).manual_seed (0 )
285284
286285        lora_model_id  =  "hf-internal-testing/lora_dreambooth_dog_example" 
287-          card   =   RepoCard . load ( lora_model_id ) 
288-         base_model_id  =  card . data . to_dict ()[ "base_model" ] 
286+ 
287+         base_model_id  =  "Jiali/stable-diffusion-1.5" 
289288
290289        pipe  =  StableDiffusionPipeline .from_pretrained (base_model_id , safety_checker = None )
291290        pipe  =  pipe .to (torch_device )
@@ -308,8 +307,8 @@ def test_dreambooth_text_encoder_new_format(self):
308307        generator  =  torch .Generator ().manual_seed (0 )
309308
310309        lora_model_id  =  "hf-internal-testing/lora-trained" 
311-          card   =   RepoCard . load ( lora_model_id ) 
312-         base_model_id  =  card . data . to_dict ()[ "base_model" ] 
310+ 
311+         base_model_id  =  "Jiali/stable-diffusion-1.5" 
313312
314313        pipe  =  StableDiffusionPipeline .from_pretrained (base_model_id , safety_checker = None )
315314        pipe  =  pipe .to (torch_device )
@@ -420,7 +419,7 @@ def test_a1111_with_sequential_cpu_offload(self):
420419    def  test_kohya_sd_v15_with_higher_dimensions (self ):
421420        generator  =  torch .Generator ().manual_seed (0 )
422421
423-         pipe  =  StableDiffusionPipeline .from_pretrained ("runwayml /stable-diffusion-v1- 5" , safety_checker = None ).to (
422+         pipe  =  StableDiffusionPipeline .from_pretrained ("Jiali /stable-diffusion-1. 5" , safety_checker = None ).to (
424423            torch_device 
425424        )
426425        lora_model_id  =  "hf-internal-testing/urushisato-lora" 
@@ -444,8 +443,8 @@ def test_vanilla_funetuning(self):
444443        generator  =  torch .Generator ().manual_seed (0 )
445444
446445        lora_model_id  =  "hf-internal-testing/sd-model-finetuned-lora-t4" 
447-          card   =   RepoCard . load ( lora_model_id ) 
448-         base_model_id  =  card . data . to_dict ()[ "base_model" ] 
446+ 
447+         base_model_id  =  "Jiali/stable-diffusion-1.5" 
449448
450449        pipe  =  StableDiffusionPipeline .from_pretrained (base_model_id , safety_checker = None )
451450        pipe  =  pipe .to (torch_device )
@@ -468,7 +467,7 @@ def test_unload_kohya_lora(self):
468467        prompt  =  "masterpiece, best quality, mountain" 
469468        num_inference_steps  =  2 
470469
471-         pipe  =  StableDiffusionPipeline .from_pretrained ("runwayml /stable-diffusion-v1- 5" , safety_checker = None ).to (
470+         pipe  =  StableDiffusionPipeline .from_pretrained ("Jiali /stable-diffusion-1. 5" , safety_checker = None ).to (
472471            torch_device 
473472        )
474473        initial_images  =  pipe (
@@ -506,7 +505,7 @@ def test_load_unload_load_kohya_lora(self):
506505        prompt  =  "masterpiece, best quality, mountain" 
507506        num_inference_steps  =  2 
508507
509-         pipe  =  StableDiffusionPipeline .from_pretrained ("runwayml /stable-diffusion-v1- 5" , safety_checker = None ).to (
508+         pipe  =  StableDiffusionPipeline .from_pretrained ("Jiali /stable-diffusion-1. 5" , safety_checker = None ).to (
510509            torch_device 
511510        )
512511        initial_images  =  pipe (
@@ -548,9 +547,9 @@ def test_load_unload_load_kohya_lora(self):
548547
549548    def  test_not_empty_state_dict (self ):
550549        # Makes sure https://github.com/huggingface/diffusers/issues/7054 does not happen again 
551-         pipe  =  AutoPipelineForText2Image .from_pretrained (
552-             "runwayml/stable-diffusion-v1-5" ,  torch_dtype = torch . float16 
553-         ). to ( torch_device ) 
550+         pipe  =  AutoPipelineForText2Image .from_pretrained ("Jiali/stable-diffusion-1.5" ,  torch_dtype = torch . float16 ). to ( 
551+             torch_device 
552+         )
554553        pipe .scheduler  =  LCMScheduler .from_config (pipe .scheduler .config )
555554
556555        cached_file  =  hf_hub_download ("hf-internal-testing/lcm-lora-test-sd-v1-5" , "test_lora.safetensors" )
@@ -562,9 +561,9 @@ def test_not_empty_state_dict(self):
562561
563562    def  test_load_unload_load_state_dict (self ):
564563        # Makes sure https://github.com/huggingface/diffusers/issues/7054 does not happen again 
565-         pipe  =  AutoPipelineForText2Image .from_pretrained (
566-             "runwayml/stable-diffusion-v1-5" ,  torch_dtype = torch . float16 
567-         ). to ( torch_device ) 
564+         pipe  =  AutoPipelineForText2Image .from_pretrained ("Jiali/stable-diffusion-1.5" ,  torch_dtype = torch . float16 ). to ( 
565+             torch_device 
566+         )
568567        pipe .scheduler  =  LCMScheduler .from_config (pipe .scheduler .config )
569568
570569        cached_file  =  hf_hub_download ("hf-internal-testing/lcm-lora-test-sd-v1-5" , "test_lora.safetensors" )
@@ -581,7 +580,7 @@ def test_load_unload_load_state_dict(self):
581580        release_memory (pipe )
582581
583582    def  test_sdv1_5_lcm_lora (self ):
584-         pipe  =  DiffusionPipeline .from_pretrained ("runwayml /stable-diffusion-v1- 5" , torch_dtype = torch .float16 )
583+         pipe  =  DiffusionPipeline .from_pretrained ("Jiali /stable-diffusion-1. 5" , torch_dtype = torch .float16 )
585584        pipe .to (torch_device )
586585        pipe .scheduler  =  LCMScheduler .from_config (pipe .scheduler .config )
587586
@@ -609,7 +608,7 @@ def test_sdv1_5_lcm_lora(self):
609608        release_memory (pipe )
610609
611610    def  test_sdv1_5_lcm_lora_img2img (self ):
612-         pipe  =  AutoPipelineForImage2Image .from_pretrained ("runwayml /stable-diffusion-v1- 5" , torch_dtype = torch .float16 )
611+         pipe  =  AutoPipelineForImage2Image .from_pretrained ("Jiali /stable-diffusion-1. 5" , torch_dtype = torch .float16 )
613612        pipe .to (torch_device )
614613        pipe .scheduler  =  LCMScheduler .from_config (pipe .scheduler .config )
615614
@@ -650,7 +649,7 @@ def test_sd_load_civitai_empty_network_alpha(self):
650649        This test simply checks that loading a LoRA with an empty network alpha works fine 
651650        See: https://github.com/huggingface/diffusers/issues/5606 
652651        """ 
653-         pipeline  =  StableDiffusionPipeline .from_pretrained ("runwayml /stable-diffusion-v1- 5" )
652+         pipeline  =  StableDiffusionPipeline .from_pretrained ("Jiali /stable-diffusion-1. 5" )
654653        pipeline .enable_sequential_cpu_offload ()
655654        civitai_path  =  hf_hub_download ("ybelkada/test-ahi-civitai" , "ahi_lora_weights.safetensors" )
656655        pipeline .load_lora_weights (civitai_path , adapter_name = "ahri" )
0 commit comments