Compare commits

..

1 Commits

Author SHA1 Message Date
Dhruv Nair fef7e363a1 update 2024-02-16 10:58:39 +00:00
2 changed files with 4 additions and 3 deletions
@@ -48,4 +48,4 @@ if __name__ == "__main__":
# skip loading position embeddings # skip loading position embeddings
adapter.load_state_dict(conv_state_dict, strict=False) adapter.load_state_dict(conv_state_dict, strict=False)
adapter.save_pretrained(args.output_path) adapter.save_pretrained(args.output_path)
adapter.save_pretrained(args.output_path, variant="fp16", torch_dtype=torch.float16) adapter.to(torch.float16).save_pretrained(args.output_path, variant="fp16")
@@ -559,16 +559,17 @@ class ControlNetInpaintPipelineSlowTests(unittest.TestCase):
def test_load_local(self): def test_load_local(self):
controlnet = ControlNetModel.from_pretrained("lllyasviel/control_v11p_sd15_canny") controlnet = ControlNetModel.from_pretrained("lllyasviel/control_v11p_sd15_canny")
pipe_1 = StableDiffusionControlNetInpaintPipeline.from_pretrained( pipe_1 = StableDiffusionControlNetInpaintPipeline.from_pretrained(
"runwayml/stable-diffusion-inpainting", safety_checker=None, controlnet=controlnet "runwayml/stable-diffusion-v1-5", safety_checker=None, controlnet=controlnet
) )
controlnet = ControlNetModel.from_single_file( controlnet = ControlNetModel.from_single_file(
"https://huggingface.co/lllyasviel/ControlNet-v1-1/blob/main/control_v11p_sd15_canny.pth" "https://huggingface.co/lllyasviel/ControlNet-v1-1/blob/main/control_v11p_sd15_canny.pth"
) )
pipe_2 = StableDiffusionControlNetInpaintPipeline.from_single_file( pipe_2 = StableDiffusionControlNetInpaintPipeline.from_single_file(
"https://huggingface.co/runwayml/stable-diffusion-inpainting/blob/main/sd-v1-5-inpainting.ckpt", "https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned-emaonly.safetensors",
safety_checker=None, safety_checker=None,
controlnet=controlnet, controlnet=controlnet,
scheduler_type="pndm",
) )
control_image = load_image( control_image = load_image(
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/sd_controlnet/bird_canny.png" "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/sd_controlnet/bird_canny.png"