MCPcopy Create free account
hub / github.com/TencentARC/BrushNet / __init__

Method __init__

benchmarks/base_classes.py:243–257  ·  view source on GitHub ↗
(self, args)

Source from the content-addressed store, hash-verified

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(

Callers

nothing calls this directly

Calls 4

load_ip_adapterMethod · 0.80
toMethod · 0.45
from_pretrainedMethod · 0.45

Tested by

no test coverage detected