Skip to content

Commit

Permalink
Move custom workflow ui to its own file
Browse files Browse the repository at this point in the history
  • Loading branch information
Acly committed Oct 3, 2024
1 parent 4699f72 commit 5356b9d
Show file tree
Hide file tree
Showing 4 changed files with 551 additions and 544 deletions.
8 changes: 6 additions & 2 deletions ai_diffusion/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,14 @@ def generate_custom(self):
for md in self.custom.metadata:
if md.kind is ParamKind.image_layer:
layer = self.layers.find(QUuid(params[md.name]))
params[md.name] = ensure(layer).get_pixels(bounds)
if layer is None:
raise ValueError(f"Input layer for parameter {md.name} not found")
params[md.name] = layer.get_pixels(bounds)
elif md.kind is ParamKind.mask_layer:
layer = self.layers.find(QUuid(params[md.name]))
params[md.name] = ensure(layer).get_mask(bounds)
if layer is None:
raise ValueError(f"Input layer for parameter {md.name} not found")
params[md.name] = layer.get_mask(bounds)

input = WorkflowInput(
WorkflowKind.custom,
Expand Down
Loading

0 comments on commit 5356b9d

Please sign in to comment.