Spaces:
Paused
Paused
lllyasviel
commited on
Commit
·
deba410
1
Parent(s):
8ee75ad
webui.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import os
|
2 |
import random
|
3 |
import torch
|
|
|
4 |
|
5 |
from comfy.sd import load_checkpoint_guess_config
|
6 |
from nodes import VAEDecode, KSamplerAdvanced, EmptyLatentImage, SaveImage, CLIPTextEncode
|
@@ -42,4 +43,8 @@ with torch.no_grad():
|
|
42 |
|
43 |
vae_decoded = opVAEDecode.decode(samples=samples, vae=xl_base_vae)[0]
|
44 |
|
45 |
-
|
|
|
|
|
|
|
|
|
|
1 |
import os
|
2 |
import random
|
3 |
import torch
|
4 |
+
import numpy as np
|
5 |
|
6 |
from comfy.sd import load_checkpoint_guess_config
|
7 |
from nodes import VAEDecode, KSamplerAdvanced, EmptyLatentImage, SaveImage, CLIPTextEncode
|
|
|
43 |
|
44 |
vae_decoded = opVAEDecode.decode(samples=samples, vae=xl_base_vae)[0]
|
45 |
|
46 |
+
for image in vae_decoded:
|
47 |
+
i = 255. * image.cpu().numpy()
|
48 |
+
img = np.clip(i, 0, 255).astype(np.uint8)
|
49 |
+
import cv2
|
50 |
+
cv2.imwrite('a.png', img[:, :, ::-1])
|