mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-08 22:35:09 +00:00
Fix dtype issue in PyTorch 2.0 for generating samples in training sdxl network
This commit is contained in:
@@ -925,7 +925,7 @@ class SdxlStableDiffusionLongPromptWeightingPipeline:
|
|||||||
|
|
||||||
unet_dtype = self.unet.dtype
|
unet_dtype = self.unet.dtype
|
||||||
dtype = unet_dtype
|
dtype = unet_dtype
|
||||||
if dtype.itemsize == 1: # fp8
|
if hasattr(dtype, "itemsize") and dtype.itemsize == 1: # fp8
|
||||||
dtype = torch.float16
|
dtype = torch.float16
|
||||||
self.unet.to(dtype)
|
self.unet.to(dtype)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user