Skip to content

Commit

Permalink
implement inpaint
Browse files Browse the repository at this point in the history
  • Loading branch information
lllyasviel committed May 11, 2023
1 parent 181e151 commit 9b93ff7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cldm/ddim_hacked.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def ddim_sampling(self, cond, shape,

if mask is not None:
assert x0 is not None
img_orig = self.model.q_sample(x0, ts) # TODO: deterministic forward pass?
img_orig = self.model.q_sample(x0, ts)
img = img_orig * mask + (1. - mask) * img

if ucg_schedule is not None:
Expand Down
2 changes: 1 addition & 1 deletion gradio_inpaint.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def process(input_image_and_mask, prompt, a_prompt, n_prompt, num_samples, image
samples, intermediates = ddim_sampler.sample(ddim_steps, num_samples,
shape, cond, verbose=False, eta=eta,
unconditional_guidance_scale=scale,
unconditional_conditioning=un_cond, x0=x0, mask=mask)
unconditional_conditioning=un_cond, x0=x0, mask=1 - mask)

if config.save_memory:
model.low_vram_shift(is_diffusing=False)
Expand Down

0 comments on commit 9b93ff7

Please sign in to comment.