INNER CODE UNIT · Python
init_process
OpenTexture/Paint3D · pipeline_paint3d_stage1.py:109
def init_process(opt):
outdir = opt.outdir
os.makedirs(outdir, exist_ok=True)
pathdir, filename = Path(opt.render_config).parent, Path(opt.render_config).stem
sys.path.append(str(pathdir))
render_cfg = __import__(filename, ).TrainConfig()
utils.seed_everything(render_cfg.optim.seed)
sd_cfg = OmegaConf.load(opt.sd_config)
render_cfg.log.exp_path = str(outdir)
if opt.prompt is not None:
sd_cfg.txt2img.prompt = opt.prompt
if opt.ip_adapter_image_path is not None:
sd_cfg.txt2img.ip_adapter_image_path = opt.ip_adapter_image_path
sd_cfg.inpaint.ip_adapter_image_path = opt.ip_adapter_image_path
if opt.mesh_path is not None:
render_cfg.guide.shape_path = opt.mesh_path