INNER CODE UNIT · Python

UV_gen

OpenTexture/Paint3D · pipeline_UV_only.py:23

def UV_gen(sd_cfg, cnet, mesh_model, outdir,):
    print(f"rendering texture and position map")
    UV_pos = mesh_model.UV_pos_render()
    UV_pos_path = os.path.join(outdir, f"UV_pos.png")
    utils.save_tensor_image(UV_pos.permute(0, 3, 1, 2), UV_pos_path)

    # UV inpaint
    p_cfg = sd_cfg.txt2img
    p_cfg.controlnet_units[0].condition_image_path = UV_pos_path

    images = cnet.infernece(config=p_cfg)
    for i, img in enumerate(images):
        save_path = os.path.join(outdir, f'UV_gen_res_{i}.png')
        img.save(save_path)
    return images


def init_process(opt):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…