Skip to content

Commit

Permalink
use result image bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
Acly committed Feb 8, 2025
1 parent 9536fd0 commit b4ddf85
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ai_diffusion/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,14 +557,14 @@ def hide_preview(self):
self._layer.hide()

def apply_result(self, image: Image, params: JobParams, behavior: ApplyBehavior, prefix=""):
if image.extent != params.bounds.extent:
image = Image.crop(image, Bounds(0, 0, *params.bounds.extent))
# if image.extent != params.bounds.extent:
# image = Image.crop(image, Bounds(0, 0, *params.bounds.extent))
if len(params.regions) == 0:
if behavior is ApplyBehavior.replace:
self.layers.update_layer_image(self.layers.active, image, params.bounds)
else:
name = f"{prefix}{trim_text(params.name, 200)} ({params.seed})"
self.layers.create(name, image, params.bounds)
self.layers.create(name, image, Bounds(0, 0, *image.extent))
else: # apply to regions
with RestoreActiveLayer(self.layers) as restore:
active_id = Region.link_target(self.layers.active).id_string
Expand Down

0 comments on commit b4ddf85

Please sign in to comment.