Skip to content

Inpainting image generation engine

InpaintingImageGenerationEngine

Bases: BaseImageGenerationEngine

Source code in griptape/griptape/engines/image/inpainting_image_generation_engine.py
@define
class InpaintingImageGenerationEngine(BaseImageGenerationEngine):
    def run(
        self,
        prompts: list[str],
        image: ImageArtifact,
        mask: ImageArtifact,
        negative_prompts: list[str] | None = None,
        rulesets: list[Ruleset] | None = None,
        negative_rulesets: list[Ruleset] | None = None,
    ) -> ImageArtifact:
        prompts = self._ruleset_to_prompts(prompts, rulesets)
        negative_prompts = self._ruleset_to_prompts(negative_prompts, negative_rulesets)

        return self.image_generation_driver.run_image_inpainting(
            prompts, image=image, mask=mask, negative_prompts=negative_prompts
        )

run(prompts, image, mask, negative_prompts=None, rulesets=None, negative_rulesets=None)

Source code in griptape/griptape/engines/image/inpainting_image_generation_engine.py
def run(
    self,
    prompts: list[str],
    image: ImageArtifact,
    mask: ImageArtifact,
    negative_prompts: list[str] | None = None,
    rulesets: list[Ruleset] | None = None,
    negative_rulesets: list[Ruleset] | None = None,
) -> ImageArtifact:
    prompts = self._ruleset_to_prompts(prompts, rulesets)
    negative_prompts = self._ruleset_to_prompts(negative_prompts, negative_rulesets)

    return self.image_generation_driver.run_image_inpainting(
        prompts, image=image, mask=mask, negative_prompts=negative_prompts
    )