(self, args)
| 241 | image = load_image(url) |
| 242 | |
| 243 | def __init__(self, args): |
| 244 | pipe = self.pipeline_class.from_pretrained(args.ckpt, torch_dtype=torch.float16).to("cuda") |
| 245 | pipe.load_ip_adapter( |
| 246 | args.ip_adapter_id[0], |
| 247 | subfolder="models" if "sdxl" not in args.ip_adapter_id[1] else "sdxl_models", |
| 248 | weight_name=args.ip_adapter_id[1], |
| 249 | ) |
| 250 | |
| 251 | if args.run_compile: |
| 252 | pipe.unet.to(memory_format=torch.channels_last) |
| 253 | print("Run torch compile") |
| 254 | pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True) |
| 255 | |
| 256 | pipe.set_progress_bar_config(disable=True) |
| 257 | self.pipe = pipe |
| 258 | |
| 259 | def run_inference(self, pipe, args): |
| 260 | _ = pipe( |
nothing calls this directly
no test coverage detected