MCPcopy Create free account
hub / github.com/thygate/stable-diffusion-webui-depthmap-script / repaint_info

Function repaint_info

inpaint/mesh_tools.py:911–922  ·  view source on GitHub ↗
(mesh, cc, x_anchor, y_anchor, source_type)

Source from the content-addressed store, hash-verified

909 return omap, revise_flag
910
911def repaint_info(mesh, cc, x_anchor, y_anchor, source_type):
912 if source_type == 'rgb':
913 feat = np.zeros((3, x_anchor[1] - x_anchor[0], y_anchor[1] - y_anchor[0]))
914 else:
915 feat = np.zeros((1, x_anchor[1] - x_anchor[0], y_anchor[1] - y_anchor[0]))
916 for node in cc:
917 if source_type == 'rgb':
918 feat[:, node[0] - x_anchor[0], node[1] - y_anchor[0]] = np.array(mesh.nodes[node]['color']) / 255.
919 elif source_type == 'd':
920 feat[:, node[0] - x_anchor[0], node[1] - y_anchor[0]] = abs(node[2])
921
922 return feat
923
924def get_context_from_nodes(mesh, cc, H, W, source_type=''):
925 if 'rgb' in source_type or 'color' in source_type:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected