mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-04-28 03:12:31 +08:00
Guard full Trellis2 conditioning image_size restore
This commit is contained in:
parent
04099ef605
commit
d7416e5690
@ -264,12 +264,12 @@ def run_conditioning(model, cropped_img_tensor, include_1024=True):
|
|||||||
img_t = torch.from_numpy(img_np).permute(2, 0, 1).unsqueeze(0).to(torch_device)
|
img_t = torch.from_numpy(img_np).permute(2, 0, 1).unsqueeze(0).to(torch_device)
|
||||||
return (img_t - dino_mean.to(torch_device)) / dino_std.to(torch_device)
|
return (img_t - dino_mean.to(torch_device)) / dino_std.to(torch_device)
|
||||||
|
|
||||||
model_internal.image_size = 512
|
|
||||||
input_512 = prepare_tensor(cropped_img_tensor, 512)
|
|
||||||
cond_512 = model_internal(input_512, skip_norm_elementwise=True)[0]
|
|
||||||
|
|
||||||
cond_1024 = None
|
cond_1024 = None
|
||||||
try:
|
try:
|
||||||
|
model_internal.image_size = 512
|
||||||
|
input_512 = prepare_tensor(cropped_img_tensor, 512)
|
||||||
|
cond_512 = model_internal(input_512, skip_norm_elementwise=True)[0]
|
||||||
|
|
||||||
if include_1024:
|
if include_1024:
|
||||||
model_internal.image_size = 1024
|
model_internal.image_size = 1024
|
||||||
input_1024 = prepare_tensor(cropped_img_tensor, 1024)
|
input_1024 = prepare_tensor(cropped_img_tensor, 1024)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user