(image, path, basename, **kwargs)
| 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? |
nothing calls this directly
no test coverage detected