Skip to content

Commit 08baf9b

Browse files
committed
fix: check against NaNs in images
1 parent c27bb50 commit 08baf9b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

examples/DDIM/main.jl

+4
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,10 @@ end
307307

308308
function save_images(output_dir, images::Vector{<:AbstractMatrix{<:RGB}})
309309
for (i, img) in enumerate(images)
310+
if any(isnan, img)
311+
@warn "NaN image found in the generated images. Skipping..."
312+
continue
313+
end
310314
save(joinpath(output_dir, "img_$(i).png"), img)
311315
end
312316
end

0 commit comments

Comments
 (0)