()
| 428 | pipeline = unmerge_lora(pipeline, lora_path, lora_weight, device=device) |
| 429 | |
| 430 | def save_results(): |
| 431 | if not os.path.exists(save_path): |
| 432 | os.makedirs(save_path, exist_ok=True) |
| 433 | |
| 434 | index = len([path for path in os.listdir(save_path)]) + 1 |
| 435 | prefix = str(index).zfill(8) |
| 436 | if num_frames == 1: |
| 437 | video_path = os.path.join(save_path, prefix + ".png") |
| 438 | |
| 439 | image = sample[0, :, 0] |
| 440 | image = image.transpose(0, 1).transpose(1, 2) |
| 441 | image = (image * 255).numpy().astype(np.uint8) |
| 442 | image = Image.fromarray(image) |
| 443 | image.save(video_path) |
| 444 | else: |
| 445 | video_path = os.path.join(save_path, prefix + ".mp4") |
| 446 | save_videos_grid(sample, video_path, fps=fps) |
| 447 | |
| 448 | def simple_save_video(): |
| 449 | if not os.path.exists(save_path): |
nothing calls this directly
no test coverage detected