Bria FIBO Edit Gemini Prompt to JSON
This modular pipeline block uses Gemini to turn a plain-language image-edit instruction and its reference image or images into the structured JSON consumed by briaai/Fibo-Edit-1.5-base and briaai/Fibo-Edit-1.5-turbo.
Set your Gemini API key before loading the block:
export GEMINI_API_KEY="your-api-key"
Usage
from diffusers.modular_pipelines import ModularPipelineBlocks
from PIL import Image
block = ModularPipelineBlocks.from_pretrained(
"briaai/FIBO-edit-gemini-prompt-to-JSON",
trust_remote_code=True,
).init_pipeline()
# Single reference
image = Image.open("source.png")
output = block(image=image, prompt="Change the car color to green")
json_prompt = output.values["json_prompt"]
# Multiple ordered references
references = [Image.open("subject.png"), Image.open("setting.png")]
output = block(
image=references,
prompt="Place the subject from <image_1> in the setting from <image_2>",
)
json_prompt = output.values["json_prompt"]
# Masked edit (one reference only)
mask = Image.open("mask.png")
output = block(image=image, mask_image=mask, prompt="Replace the masked region with flowers")
json_prompt = output.values["json_prompt"]
- Downloads last month
- 113
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support