Skip to content

Commit

Permalink
minor.
Browse files Browse the repository at this point in the history
  • Loading branch information
dxli94 committed Jun 20, 2023
1 parent 91d53b4 commit 72c48db
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lavis/models/blip_diffusion_models/blip_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,19 +281,18 @@ def _inversion_transform(self, image, target_size=512):
def edit(
self,
samples,
latents=None,
guidance_scale=7.5,
height=512,
width=512,
seed=42,
num_inference_steps=50,
num_inversion_steps=50,
neg_prompt="",
):
raw_image = samples["raw_image"]
raw_image = self._inversion_transform(raw_image)

if latents is None:
latents = self.get_image_latents(raw_image, rng_generator=None)
latents = self.get_image_latents(raw_image, rng_generator=None)

latents = self._ddim_inverse(
samples=samples,
Expand All @@ -302,7 +301,7 @@ def edit(
guidance_scale=1.0,
height=height,
width=width,
num_inference_steps=num_inference_steps,
num_inference_steps=num_inversion_steps,
)

recon_image = self.generate_then_edit(
Expand Down

0 comments on commit 72c48db

Please sign in to comment.