Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figure out and fix marination and inpainting. #109

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions stable_audio_tools/inference/generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,6 @@ def build_mask(sample_size, mask_args):
# marination finishes the inpainting early in the denoising schedule, and lets audio get changed in the final rounds
if marination > 0:
mask = mask * (1-marination)
mask = 1 - mask
#print(mask)
return mask
2 changes: 1 addition & 1 deletion stable_audio_tools/inference/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def sample(model, x, steps, eta, **extra_args):
def get_bmask(i, steps, mask):
strength = (i+1)/(steps)
# convert to binary mask
bmask = torch.where(mask<=strength,1,0)
bmask = torch.where(mask<strength,0,1)
return bmask

def make_cond_model_fn(model, cond_fn):
Expand Down