MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / pad_encoder_attention_mask

Function pad_encoder_attention_mask

src/models/ace_step/diffusion.cpp:707–716  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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
713bool dcw_mode_is_valid(const std::string & mode) {
714 return mode == "low" || mode == "high" || mode == "double" || mode == "pix";
715}
716
717bool 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");

Callers 1

generate_latentsMethod · 0.85

Calls 4

copyFunction · 0.85
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected