Upload folder using huggingface_hub
Browse files
external/scripts/day_night_ip2p.py
CHANGED
|
@@ -28,7 +28,7 @@ class Script:
|
|
| 28 |
|
| 29 |
pipe = StableDiffusionInstructPix2PixPipeline.from_pretrained(
|
| 30 |
model_id,
|
| 31 |
-
|
| 32 |
torch_dtype=torch.float16,
|
| 33 |
safety_checker=None,
|
| 34 |
).to("cuda")
|
|
|
|
| 28 |
|
| 29 |
pipe = StableDiffusionInstructPix2PixPipeline.from_pretrained(
|
| 30 |
model_id,
|
| 31 |
+
token=get_hf_token(),
|
| 32 |
torch_dtype=torch.float16,
|
| 33 |
safety_checker=None,
|
| 34 |
).to("cuda")
|
internals/pipelines/commons.py
CHANGED
|
@@ -44,7 +44,7 @@ class Text2Img(AbstractPipeline):
|
|
| 44 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
| 45 |
model_dir,
|
| 46 |
torch_dtype=torch.float16,
|
| 47 |
-
|
| 48 |
use_safetensors=True,
|
| 49 |
variant=get_base_model_variant(),
|
| 50 |
)
|
|
@@ -53,7 +53,7 @@ class Text2Img(AbstractPipeline):
|
|
| 53 |
self.pipe = pipe
|
| 54 |
else:
|
| 55 |
self.pipe = two_step_pipeline.from_pretrained(
|
| 56 |
-
model_dir, torch_dtype=torch.float16,
|
| 57 |
).to("cuda")
|
| 58 |
self.__patch()
|
| 59 |
|
|
@@ -143,13 +143,13 @@ class Img2Img(AbstractPipeline):
|
|
| 143 |
self.pipe = StableDiffusionXLImg2ImgPipeline.from_pretrained(
|
| 144 |
model_dir,
|
| 145 |
torch_dtype=torch.float16,
|
| 146 |
-
|
| 147 |
variant=get_base_model_variant(),
|
| 148 |
use_safetensors=True,
|
| 149 |
).to("cuda")
|
| 150 |
else:
|
| 151 |
self.pipe = StableDiffusionImg2ImgPipeline.from_pretrained(
|
| 152 |
-
model_dir, torch_dtype=torch.float16,
|
| 153 |
).to("cuda")
|
| 154 |
self.__patch()
|
| 155 |
|
|
|
|
| 44 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
| 45 |
model_dir,
|
| 46 |
torch_dtype=torch.float16,
|
| 47 |
+
token=get_hf_token(),
|
| 48 |
use_safetensors=True,
|
| 49 |
variant=get_base_model_variant(),
|
| 50 |
)
|
|
|
|
| 53 |
self.pipe = pipe
|
| 54 |
else:
|
| 55 |
self.pipe = two_step_pipeline.from_pretrained(
|
| 56 |
+
model_dir, torch_dtype=torch.float16, token=get_hf_token()
|
| 57 |
).to("cuda")
|
| 58 |
self.__patch()
|
| 59 |
|
|
|
|
| 143 |
self.pipe = StableDiffusionXLImg2ImgPipeline.from_pretrained(
|
| 144 |
model_dir,
|
| 145 |
torch_dtype=torch.float16,
|
| 146 |
+
token=get_hf_token(),
|
| 147 |
variant=get_base_model_variant(),
|
| 148 |
use_safetensors=True,
|
| 149 |
).to("cuda")
|
| 150 |
else:
|
| 151 |
self.pipe = StableDiffusionImg2ImgPipeline.from_pretrained(
|
| 152 |
+
model_dir, torch_dtype=torch.float16, token=get_hf_token()
|
| 153 |
).to("cuda")
|
| 154 |
self.__patch()
|
| 155 |
|
internals/pipelines/controlnets.py
CHANGED
|
@@ -67,7 +67,7 @@ class StableDiffusionNetworkModelPipelineLoader:
|
|
| 67 |
kwargs = {
|
| 68 |
"pretrained_model_name_or_path": get_model_dir(),
|
| 69 |
"torch_dtype": torch.float16,
|
| 70 |
-
"
|
| 71 |
"cache_dir": get_hf_cache_dir(),
|
| 72 |
}
|
| 73 |
else:
|
|
|
|
| 67 |
kwargs = {
|
| 68 |
"pretrained_model_name_or_path": get_model_dir(),
|
| 69 |
"torch_dtype": torch.float16,
|
| 70 |
+
"token": get_hf_token(),
|
| 71 |
"cache_dir": get_hf_cache_dir(),
|
| 72 |
}
|
| 73 |
else:
|
internals/pipelines/inpainter.py
CHANGED
|
@@ -36,7 +36,7 @@ class InPainter(AbstractPipeline):
|
|
| 36 |
get_inpaint_model_path(),
|
| 37 |
torch_dtype=torch.float16,
|
| 38 |
cache_dir=get_hf_cache_dir(),
|
| 39 |
-
|
| 40 |
variant=get_base_inpaint_model_variant(),
|
| 41 |
).to("cuda")
|
| 42 |
else:
|
|
@@ -44,7 +44,7 @@ class InPainter(AbstractPipeline):
|
|
| 44 |
get_inpaint_model_path(),
|
| 45 |
torch_dtype=torch.float16,
|
| 46 |
cache_dir=get_hf_cache_dir(),
|
| 47 |
-
|
| 48 |
).to("cuda")
|
| 49 |
|
| 50 |
disable_safety_checker(self.pipe)
|
|
|
|
| 36 |
get_inpaint_model_path(),
|
| 37 |
torch_dtype=torch.float16,
|
| 38 |
cache_dir=get_hf_cache_dir(),
|
| 39 |
+
token=get_hf_token(),
|
| 40 |
variant=get_base_inpaint_model_variant(),
|
| 41 |
).to("cuda")
|
| 42 |
else:
|
|
|
|
| 44 |
get_inpaint_model_path(),
|
| 45 |
torch_dtype=torch.float16,
|
| 46 |
cache_dir=get_hf_cache_dir(),
|
| 47 |
+
token=get_hf_token(),
|
| 48 |
).to("cuda")
|
| 49 |
|
| 50 |
disable_safety_checker(self.pipe)
|
internals/pipelines/replace_background.py
CHANGED
|
@@ -59,7 +59,7 @@ class ReplaceBackground(AbstractPipeline):
|
|
| 59 |
controlnet=controlnet_model,
|
| 60 |
torch_dtype=torch.float16,
|
| 61 |
cache_dir=get_hf_cache_dir(),
|
| 62 |
-
|
| 63 |
)
|
| 64 |
pipe.enable_xformers_memory_efficient_attention()
|
| 65 |
pipe.enable_vae_slicing()
|
|
|
|
| 59 |
controlnet=controlnet_model,
|
| 60 |
torch_dtype=torch.float16,
|
| 61 |
cache_dir=get_hf_cache_dir(),
|
| 62 |
+
token=get_hf_token(),
|
| 63 |
)
|
| 64 |
pipe.enable_xformers_memory_efficient_attention()
|
| 65 |
pipe.enable_vae_slicing()
|