mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-11 23:00:51 +08:00
first modification
This commit is contained in:
parent
cc127eeabd
commit
ad3c004e5c
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,3 +8,4 @@ temp/
|
||||
custom_nodes/
|
||||
!custom_nodes/example_node.py.example
|
||||
extra_model_paths.yaml
|
||||
.idea/
|
||||
@ -221,7 +221,9 @@ class KSamplerX0Inpaint(torch.nn.Module):
|
||||
def forward(self, x, sigma, uncond, cond, cond_scale, denoise_mask, cond_concat=None):
|
||||
if denoise_mask is not None:
|
||||
latent_mask = 1. - denoise_mask
|
||||
x = x * denoise_mask + (self.latent_image + self.noise * sigma) * latent_mask
|
||||
if not torch.all(torch.eq(sigma, sigma[0])):
|
||||
raise ValueError('sigma must be the same for all timesteps when using denoise_mask')
|
||||
x = x * denoise_mask + (self.latent_image + self.noise * sigma[0]) * latent_mask
|
||||
out = self.inner_model(x, sigma, cond=cond, uncond=uncond, cond_scale=cond_scale, cond_concat=cond_concat)
|
||||
if denoise_mask is not None:
|
||||
out *= denoise_mask
|
||||
|
||||
Loading…
Reference in New Issue
Block a user