Skip to content

Commit

Permalink
added back engines to work with griptape v0.34.3
Browse files Browse the repository at this point in the history
  • Loading branch information
shhlife committed Nov 25, 2024
1 parent 0336a18 commit a668a39
Show file tree
Hide file tree
Showing 8 changed files with 161 additions and 94 deletions.
7 changes: 5 additions & 2 deletions examples/drivers/example_agent.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
from griptape.black_forest.drivers.black_forest_image_generation_driver import (
BlackForestImageGenerationDriver,
)
from griptape.engines import PromptImageGenerationEngine
from griptape.structures import Agent
from griptape.tools import FileManagerTool, PromptImageGenerationTool

agent = Agent(
tools=[
PromptImageGenerationTool(
image_generation_driver=BlackForestImageGenerationDriver(
model="flux-pro-1.1"
engine=PromptImageGenerationEngine(
image_generation_driver=BlackForestImageGenerationDriver(
model="flux-pro-1.1"
)
),
off_prompt=True,
),
Expand Down
9 changes: 6 additions & 3 deletions examples/drivers/example_agent_canny.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
from griptape.black_forest.drivers.black_forest_image_generation_driver import (
BlackForestImageGenerationDriver,
)
from griptape.engines import VariationImageGenerationEngine
from griptape.structures import Agent
from griptape.tools import FileManagerTool, VariationImageGenerationTool

agent = Agent(
tools=[
VariationImageGenerationTool(
image_generation_driver=BlackForestImageGenerationDriver(
model="flux-pro-1.0-canny", # flux-pro-1.0-canny is required for Canny.
guidance_canny=100,
engine=VariationImageGenerationEngine(
image_generation_driver=BlackForestImageGenerationDriver(
model="flux-pro-1.0-canny", # flux-pro-1.0-canny is required for Canny.
guidance_canny=100,
)
),
off_prompt=True,
),
Expand Down
7 changes: 5 additions & 2 deletions examples/drivers/example_agent_depth.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
from griptape.black_forest.drivers.black_forest_image_generation_driver import (
BlackForestImageGenerationDriver,
)
from griptape.engines import VariationImageGenerationEngine
from griptape.structures import Agent
from griptape.tools import FileManagerTool, VariationImageGenerationTool

agent = Agent(
tools=[
VariationImageGenerationTool(
image_generation_driver=BlackForestImageGenerationDriver(
model="flux-pro-1.0-depth", # flux-pro-1.0-depth is required for Depth.
engine=VariationImageGenerationEngine(
image_generation_driver=BlackForestImageGenerationDriver(
model="flux-pro-1.0-depth", # flux-pro-1.0-depth is required for Depth.
)
),
off_prompt=True,
),
Expand Down
7 changes: 5 additions & 2 deletions examples/drivers/example_agent_inpainting.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
from griptape.black_forest.drivers.black_forest_image_generation_driver import (
BlackForestImageGenerationDriver,
)
from griptape.engines import InpaintingImageGenerationEngine
from griptape.structures import Agent
from griptape.tools import FileManagerTool, InpaintingImageGenerationTool

agent = Agent(
tools=[
InpaintingImageGenerationTool(
image_generation_driver=BlackForestImageGenerationDriver(
model="flux-pro-1.0", # flux-pro-1.0 is required for inpainting.
engine=InpaintingImageGenerationEngine(
image_generation_driver=BlackForestImageGenerationDriver(
model="flux-pro-1.0", # flux-pro-1.0 is required for inpainting.
)
),
off_prompt=True,
),
Expand Down
7 changes: 5 additions & 2 deletions examples/drivers/example_agent_outpainting.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
from griptape.black_forest.drivers.black_forest_image_generation_driver import (
BlackForestImageGenerationDriver,
)
from griptape.engines import OutpaintingImageGenerationEngine
from griptape.structures import Agent
from griptape.tools import FileManagerTool, OutpaintingImageGenerationTool

agent = Agent(
tools=[
OutpaintingImageGenerationTool(
image_generation_driver=BlackForestImageGenerationDriver(
model="flux-pro-1.0", # flux-pro-1.0 is required for outpainting.
engine=OutpaintingImageGenerationEngine(
image_generation_driver=BlackForestImageGenerationDriver(
model="flux-pro-1.0", # flux-pro-1.0 is required for outpainting.
)
),
off_prompt=True,
),
Expand Down
9 changes: 6 additions & 3 deletions examples/drivers/example_agent_variation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from griptape.black_forest.drivers.black_forest_image_generation_driver import (
BlackForestImageGenerationDriver,
)
from griptape.engines import VariationImageGenerationEngine
from griptape.structures import Agent
from griptape.tools import (
FileManagerTool,
Expand All @@ -10,9 +11,11 @@
agent = Agent(
tools=[
VariationImageGenerationTool(
image_generation_driver=BlackForestImageGenerationDriver(
model="flux-pro-1.1-ultra", # flux-pro-1.1-ultra is a better model for image variation
image_prompt_strength=0.7,
engine=VariationImageGenerationEngine(
image_generation_driver=BlackForestImageGenerationDriver(
model="flux-pro-1.1-ultra", # flux-pro-1.1-ultra is a better model for image variation
image_prompt_strength=0.7,
)
),
off_prompt=True,
),
Expand Down
Loading

0 comments on commit a668a39

Please sign in to comment.