vinesmsuic commited on
Commit
118a337
1 Parent(s): f2d9a72
Files changed (1) hide show
  1. black_box_image_edit/cosxl_edit.py +11 -5
black_box_image_edit/cosxl_edit.py CHANGED
@@ -21,11 +21,17 @@ class CosXLEdit():
21
  from .cosxl.utils import set_timesteps_patched
22
 
23
  EDMEulerScheduler.set_timesteps = set_timesteps_patched
24
- #edit_file = hf_hub_download(repo_id="stabilityai/cosxl", filename="cosxl_edit.safetensors")
25
- edit_file_path = "./black_box_image_edit/cosxl/cosxl_edit.safetensors"
26
- self.pipe = CosStableDiffusionXLInstructPix2PixPipeline.from_single_file(
27
- edit_file_path, num_in_channels=8
28
- )
 
 
 
 
 
 
29
  self.pipe.scheduler = EDMEulerScheduler(sigma_min=0.002, sigma_max=120.0, sigma_data=1.0, prediction_type="v_prediction")
30
  self.pipe.to(device)
31
  self.pipe.enable_vae_tiling()
 
21
  from .cosxl.utils import set_timesteps_patched
22
 
23
  EDMEulerScheduler.set_timesteps = set_timesteps_patched
24
+
25
+ try:
26
+ edit_file = hf_hub_download(repo_id="TIGER-Lab/cosxl", filename="cosxl_edit.safetensors")
27
+ self.pipe = CosStableDiffusionXLInstructPix2PixPipeline.from_single_file(
28
+ edit_file, num_in_channels=8
29
+ )
30
+ except:
31
+ edit_file_path = "./black_box_image_edit/cosxl/cosxl_edit.safetensors"
32
+ self.pipe = CosStableDiffusionXLInstructPix2PixPipeline.from_single_file(
33
+ edit_file_path, num_in_channels=8
34
+ )
35
  self.pipe.scheduler = EDMEulerScheduler(sigma_min=0.002, sigma_max=120.0, sigma_data=1.0, prediction_type="v_prediction")
36
  self.pipe.to(device)
37
  self.pipe.enable_vae_tiling()