From c56e2c9fd1e2401b7bfb4385b3a54f8e5acc838a Mon Sep 17 00:00:00 2001 From: lvmin Date: Wed, 9 Aug 2023 15:05:02 -0700 Subject: [PATCH] i --- entry.py | 6 +++--- img.png | Bin 0 -> 4813 bytes 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 img.png diff --git a/entry.py b/entry.py index 9cdd924..b19008e 100644 --- a/entry.py +++ b/entry.py @@ -145,12 +145,12 @@ with torch.no_grad(): torch.cuda.ipc_collect() with torch.no_grad(): - model.first_stage_model.to(torch.float16).cuda() - samples_x = model.decode_first_stage(samples_z) + model.first_stage_model.cuda() + samples_x = model.decode_first_stage(samples_z.float()) samples = torch.clamp((samples_x + 1.0) / 2.0, min=0.0, max=1.0) model.first_stage_model.cpu() import cv2 - samples = einops.rearrange(samples, 'b c h w -> b h w c')[0] * 127.5 + 127.5 + samples = einops.rearrange(samples, 'b c h w -> b h w c')[0] * 255.0 samples = samples.cpu().numpy().clip(0, 255).astype(np.uint8) cv2.imwrite('img.png', samples) diff --git a/img.png b/img.png new file mode 100644 index 0000000000000000000000000000000000000000..bec943899ee6d3817c95b3212920e0730bc34cd1 GIT binary patch literal 4813 zcmeAS@N?(olHy`uVBq!ia0y~yU;#2&7&w@K)Q9>#R~Q(Crg*wIhEy=VJ;=xi6l7HR zH{Z0BhfK&DH8NcFn}spfpD_tI P#Khp~>gTe~DWM4f)szl2 literal 0 HcmV?d00001