| 705 | const std::vector<float> & clean_src_latents, |
| 706 | const std::vector<int32_t> & repaint_mask, |
| 707 | int64_t crossfade_frames, |
| 708 | int64_t channels) { |
| 709 | const auto soft_mask = build_soft_repaint_mask(repaint_mask, crossfade_frames); |
| 710 | engine::sampling::blend_by_mask_in_place(generated, clean_src_latents, soft_mask, channels); |
| 711 | } |
| 712 | |
| 713 | bool dcw_mode_is_valid(const std::string & mode) { |
| 714 | return mode == "low" || mode == "high" || mode == "double" || mode == "pix"; |
| 715 | } |
| 716 | |
| 717 | bool dcw_is_active(const AceStepGenerationOptions & options, bool reference_skips_wavelet_dcw) { |
| 718 | if (!dcw_mode_is_valid(options.dcw_mode)) { |
| 719 | throw std::runtime_error("ACE-Step diffusion dcw_mode is invalid"); |
no test coverage detected