Customize your input with more control.
Customize your input with more control.
Customize your input with more control.
Bagel is a 7B parameter multimodal model from ByteDance-Seed that can generate both text and images. This versatile model supports text-to-image generation, image-to-image editing, and image understanding capabilities through an intuitive API.
Getting up and running with Bagel takes just a few minutes. Here's everything you need to start generating content:
First, install your preferred client library:
For JavaScript/TypeScript:
For Python:
Configure your authentication by setting up your API key:
JavaScript:
Python:
Generate images from text prompts:
JavaScript:
Python:
Transform existing images with text prompts:
Extract structured information from images:
Bagel offers three main endpoints:
For image inputs, you can either provide URLs or upload files directly:
When integrating Bagel into your application:
For image inputs:
Common Issues and Solutions:
Authentication Errors:
Image Input Issues:
Generation Quality:
Bagel represents a significant advancement in multimodal AI, offering unified capabilities for both text and image tasks. Developed by ByteDance-Seed, it demonstrates strong performance across various benchmarks and provides a versatile solution for creative AI applications.
For more information and to explore the model's capabilities, visit the Bagel model page on fal.ai.
For production deployments and additional support:
bashnpm install --save @fal-ai/clientbashpip install fal-clientjavascriptimport { fal } from "@fal-ai/client";
fal.config({
credentials: "YOUR_FAL_KEY_HERE"
});pythonfrom fal import client
import os
os.environ["FAL_KEY"] = "YOUR_FAL_KEY_HERE"javascriptimport { fal } from "@fal-ai/client";
const result = await fal.subscribe("fal-ai/bagel", {
input: {
prompt: "A serene landscape with mountains at sunset"
}
});
console.log(result.image_url);pythonfrom fal import client
result = client.subscribe("fal-ai/bagel", {
"prompt": "A serene landscape with mountains at sunset"
})
print(result["image_url"])javascriptconst result = await fal.subscribe("fal-ai/bagel/edit", {
input: {
image_url: "https://example.com/your-image.jpg",
prompt: "Transform this into a watercolor painting"
}
});javascriptconst result = await fal.subscribe("fal-ai/bagel/understand", {
input: {
image_url: "https://example.com/your-image.jpg",
prompt: "Describe the contents of this image"
}
});javascripttry {
const result = await fal.subscribe("fal-ai/bagel", {
input: { prompt: "your prompt" }
});
} catch (error) {
console.error("Generation failed:", error.message);
// Implement appropriate fallback behavior
}fal-ai/bagelfal-ai/bagel/editfal-ai/bagel/understandjavascriptimport { fal } from "@fal-ai/client";
// Upload a local file
const file = new File([imageData], "image.jpg", { type: "image/jpeg" });
const url = await fal.storage.upload(file);
// Use the uploaded file
const result = await fal.subscribe("fal-ai/bagel/edit", {
input: {
image_url: url,
prompt: "Apply artistic style"
}
});