Spaces:
Runtime error
Runtime error
Update app.py
Browse files748 unmodified lines74975075175275375475575675775875976076176276376476576610 unmodified lines777778779780781782748 unmodified linesresult = model.load_state_dict(sd)model_zero_init = False@spaces.GPU()def apply_nf4_storage():device = "cuda" if torch.cuda.is_available() else "cpu"torch_device = torch.device(device)global model, model_zero_initif not model_zero_init:model = model.to(torch_device)model_zero_init = Trueapply_nf4_storage()# model = Flux().to(dtype=torch.bfloat16, device="cuda")# result = model.load_state_dict(load_file("/storage/dev/nyanko/flux-dev/flux1-dev.sft"))10 unmodified linesdevice = "cuda" if torch.cuda.is_available() else "cpu"torch_device = torch.device(device)if do_img2img and init_image is not None:init_image = get_image(init_image)if resize_img:748 unmodified lines74975075175275375410 unmodified lines765766767768769770771772773774775748 unmodified linesresult = model.load_state_dict(sd)model_zero_init = False# model = Flux().to(dtype=torch.bfloat16, device="cuda")# result = model.load_state_dict(load_file("/storage/dev/nyanko/flux-dev/flux1-dev.sft"))10 unmodified linesdevice = "cuda" if torch.cuda.is_available() else "cpu"torch_device = torch.device(device)global model, model_zero_initif not model_zero_init:model = model.to(torch_device)model_zero_init = Trueif do_img2img and init_image is not None:init_image = get_image(init_image)if resize_img:
app.py+5-12