Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,18 @@ def slice_cnet(h, h_len, w, w_len, model:comfy.controlnet.ControlBase, img):
if img is None:
img = model.cond_hint_original
hint = tiling.get_slice(img, h*8, h_len*8, w*8, w_len*8)
device = comfy.model_management.get_torch_device()
if isinstance(model, comfy.controlnet.ControlLora):
model.cond_hint = hint.float().to(model.device)
model.cond_hint = hint.float().to(device)
else:
model.cond_hint = hint.to(model.control_model.dtype).to(model.device)
model.cond_hint = hint.to(model.control_model.dtype).to(device)

def slices_T2I(h, h_len, w, w_len, model:comfy.controlnet.ControlBase, img):
model.control_input = None
if img is None:
img = model.cond_hint_original
model.cond_hint = tiling.get_slice(img, h*8, h_len*8, w*8, w_len*8).float().to(model.device)
device = comfy.model_management.get_torch_device()
model.cond_hint = tiling.get_slice(img, h*8, h_len*8, w*8, w_len*8).float().to(device)

# TODO: refactor some of the mess

Expand Down Expand Up @@ -366,4 +368,4 @@ def sample(self, model, add_noise, noise_seed, tile_width, tile_height, tiling_s
NODE_DISPLAY_NAME_MAPPINGS = {
"BNK_TiledKSamplerAdvanced": "TiledK Sampler (Advanced)",
"BNK_TiledKSampler": "Tiled KSampler",
}
}