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

Function save_image

src/backbone.py:91–101  ·  view source on GitHub ↗
(image, path, basename, **kwargs)

Source from the content-addressed store, hash-verified

89 " Some features may be missing or work differently. Please report bugs.\n")
90
91 def save_image(image, path, basename, **kwargs):
92 import os
93 os.makedirs(path, exist_ok=True)
94 if 'suffix' not in kwargs or len(kwargs['suffix']) == 0:
95 kwargs['suffix'] = ''
96 else:
97 kwargs['suffix'] = f"-{kwargs['suffix']}"
98 format = get_opt('samples_format', kwargs['extension'])
99 fullfn = os.path.join(
100 path, f"{basename}-{get_next_sequence_number(path, basename)}{kwargs['suffix']}.{format}")
101 image.save(fullfn, format=format)
102
103 def torch_gc():
104 # TODO: is this really sufficient?

Callers

nothing calls this directly

Calls 3

get_optFunction · 0.85
get_next_sequence_numberFunction · 0.85
saveMethod · 0.45

Tested by

no test coverage detected