mirror of
https://github.com/vladmandic/automatic
synced 2026-08-27 07:31:01 +02:00
fix tensor to np
This commit is contained in:
Submodule extensions-builtin/sd-webui-controlnet updated: 96dbc601a6...0d0841671e
Submodule extensions-builtin/stable-diffusion-webui-images-browser updated: 08fc2647f1...323ce7efef
@@ -757,7 +757,7 @@ def validate_sample(tensor):
|
||||
sample = 255.0 * np.moveaxis(tensor.cpu().numpy(), 0, 2)
|
||||
else:
|
||||
sample = 255.0 * tensor
|
||||
if isinstance(tensor, torch.Tensor):
|
||||
if isinstance(tensor, torch.Tensor) and hasattr(tensor, 'detach'):
|
||||
sample = sample.detach().cpu().numpy()
|
||||
with warnings.catch_warnings(record=True) as w:
|
||||
cast = sample.astype(np.uint8)
|
||||
|
||||
Reference in New Issue
Block a user