MCPcopy Index your code
hub / github.com/thygate/stable-diffusion-webui-depthmap-script / get_uniquefn

Function get_uniquefn

src/core.py:352–362  ·  view source on GitHub ↗
(outpath, basename, ext, suffix='')

Source from the content-addressed store, hash-verified

350
351
352def get_uniquefn(outpath, basename, ext, suffix=''):
353 basecount = backbone.get_next_sequence_number(outpath, basename)
354 if basecount > 0:
355 basecount -= 1
356 if suffix != '':
357 suffix = f'-{suffix}' # Dash is important for selecting unique filenames (see get_next_sequence_number)
358 for i in range(500):
359 fullfn = os.path.join(outpath, f"{basename}-{basecount + i:04}{suffix}.{ext}")
360 if not os.path.exists(fullfn):
361 return fullfn
362 return f"{basename}-99999{suffix}.{ext}" # Failback, should never be executed
363
364
365def run_3dphoto(device, img_rgb, img_depth, inputnames, outpath, gen_inpainted_mesh_demos, vid_ssaa, vid_format):

Callers 2

core_generation_funnelFunction · 0.85
run_3dphotoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected