Skip to content

Base image generation engine

BaseImageGenerationEngine

Source code in griptape/griptape/engines/image/base_image_generation_engine.py
@define
class BaseImageGenerationEngine:
    image_generation_driver: BaseImageGenerationDriver = field(kw_only=True)

    def _ruleset_to_prompts(self, prompts: list[str] | None, rulesets: list[Ruleset] | None) -> list[str]:
        if not prompts:
            prompts = []

        if rulesets:
            for ruleset in rulesets:
                prompts += [rule.value for rule in ruleset.rules]

        return prompts

image_generation_driver: BaseImageGenerationDriver = field(kw_only=True) class-attribute instance-attribute