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

cant remove add noise function in img to img #164

Open
walt798 opened this issue Jul 12, 2024 · 0 comments
Open

cant remove add noise function in img to img #164

walt798 opened this issue Jul 12, 2024 · 0 comments

Comments

@walt798
Copy link

walt798 commented Jul 12, 2024

i am trying to use streamdiffusion to create an ai video where each frame is one step of the ai by using the stream() function with only one inference step but i am getting very blurry outputs. i dug into the code and found that every time img2img is used it adds some noise to the input image in the add_noise function. you cannot disable this. i tried changing this in pipeline.py:

def add_noise(
        self,
        original_samples: torch.Tensor,
        noise: torch.Tensor,
        t_index: int,
    ) -> torch.Tensor:
        noisy_samples = (
            self.alpha_prod_t_sqrt[t_index] * original_samples
            + self.beta_prod_t_sqrt[t_index] * noise 
        )
        
        return noisy_samples

to this:

def add_noise(
        self,
        original_samples: torch.Tensor,
        noise: torch.Tensor,
        t_index: int,
    ) -> torch.Tensor:
        noisy_samples = (
            self.alpha_prod_t_sqrt[t_index] * original_samples
            
        )

        
        return noisy_samples

as you can see i removed where the noise is added but due to my lack of knowledge this just makes it so the image turns into a black blob.

any ideas how to disable noise in image to image streamdiffusion by editing the code?

Note:this isnt really a big issue but there really should be a way to disable this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@walt798 and others