instantX-research / InstantStyle-Plus

InstantStyle-Plus: Style Transfer with Content-Preserving in Text-to-Image Generation 🔥
54 stars 3 forks source link

black image occurs #2

Open tianqyun111 opened 2 months ago

tianqyun111 commented 2 months ago

When processing some pictures, most of them are normal, but a few of them will have a black screen and an error message: *image_processor.py:111: RuntimeWarning: invalid value encountered in cast, images = (images 255).round().astype("uint8")**

tianqyun111 commented 1 month ago

When processing some pictures, most of them are normal, but a few of them will have a black screen and an error message: *image_processor.py:111: RuntimeWarning: invalid value encountered in cast, images = (images 255).round().astype("uint8")**

solved it. Because of the unstable calculation of fp16,at inversion preprocess it will calculate [nan,nan,nan] tensor, which leads to the black image,change it to fp32, and solve it

mohammadalirezaee commented 1 month ago

Hi @tianqyun111 . Thanks for sharing your experience. do you think i can use bf16 instead of fp32? best regard.

tianqyun111 commented 1 month ago

Hi @tianqyun111 . Thanks for sharing your experience. do you think i can use bf16 instead of fp32? best regard.

yeah,i think you can try