MCPcopy
hub / github.com/lllyasviel/sd-forge-layerdiffuse / rgba2rgbfp32

Function rgba2rgbfp32

lib_layerdiffusion/utils.py:16–19  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

14
15
16def rgba2rgbfp32(x):
17 rgb = x[..., :3].astype(np.float32) / 255.0
18 a = x[..., 3:4].astype(np.float32) / 255.0
19 return 0.5 + (rgb - 0.5) * a
20
21
22def to255unit8(x):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected