Commit
·
118a337
1
Parent(s):
f2d9a72
update
Browse files
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 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 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()
|