cddb07a176
docs / deploy (push) Has been cancelled
docs / changes (push) Has been cancelled
docs / check-and-build (push) Has been cancelled
build container image / cpu (push) Has been cancelled
build container image / cuda (push) Has been cancelled
build container image / rocm (push) Has been cancelled
frontend checks / frontend-checks (push) Has been cancelled
frontend tests / frontend-tests (push) Has been cancelled
lfs checks / lfs-check (push) Has been cancelled
python checks / python-checks (push) Has been cancelled
python tests / py3.12: macos-default (push) Has been cancelled
python tests / py3.11: windows-cpu (push) Has been cancelled
python tests / py3.12: windows-cpu (push) Has been cancelled
python tests / py3.11: linux-cpu (push) Has been cancelled
typegen checks / typegen-checks (push) Has been cancelled
uv lock checks / uv-lock-checks (push) Has been cancelled
openapi checks / openapi-checks (push) Has been cancelled
python tests / py3.11: macos-default (push) Has been cancelled
python tests / py3.12: linux-cpu (push) Has been cancelled
47 lines
1.4 KiB
Python
47 lines
1.4 KiB
Python
from invokeai.app.invocations.baseinvocation import (
|
|
BaseInvocation,
|
|
BaseInvocationOutput,
|
|
Classification,
|
|
invocation,
|
|
invocation_output,
|
|
)
|
|
from invokeai.app.invocations.fields import (
|
|
FieldDescriptions,
|
|
FluxFillConditioningField,
|
|
InputField,
|
|
OutputField,
|
|
TensorField,
|
|
)
|
|
from invokeai.app.invocations.primitives import ImageField
|
|
from invokeai.app.services.shared.invocation_context import InvocationContext
|
|
|
|
|
|
@invocation_output("flux_fill_output")
|
|
class FluxFillOutput(BaseInvocationOutput):
|
|
"""The conditioning output of a FLUX Fill invocation."""
|
|
|
|
fill_cond: FluxFillConditioningField = OutputField(
|
|
description=FieldDescriptions.flux_redux_conditioning, title="Conditioning"
|
|
)
|
|
|
|
|
|
@invocation(
|
|
"flux_fill",
|
|
title="FLUX Fill Conditioning",
|
|
tags=["inpaint"],
|
|
category="conditioning",
|
|
version="1.0.0",
|
|
classification=Classification.Beta,
|
|
)
|
|
class FluxFillInvocation(BaseInvocation):
|
|
"""Prepare the FLUX Fill conditioning data."""
|
|
|
|
image: ImageField = InputField(description="The FLUX Fill reference image.")
|
|
mask: TensorField = InputField(
|
|
description="The bool inpainting mask. Excluded regions should be set to "
|
|
"False, included regions should be set to True.",
|
|
)
|
|
|
|
def invoke(self, context: InvocationContext) -> FluxFillOutput:
|
|
return FluxFillOutput(fill_cond=FluxFillConditioningField(image=self.image, mask=self.mask))
|