
Generated from a text prompt.
Image-to-Image

Image-Inpainting

Style Transfer

Supported modes.
Example Usage
Use the Structured Outputs API for structured, validated responses.
Text-to-Image
from vlmrun.client import VLMRun
# Initialize the VLMRun client
client = VLMRun(api_key="<VLMRUN_API_KEY>")
# Generate the image
response = client.agent.completions.create(
model="vlmrun-orion-1:auto",
messages=[
{
"role": "user",
"content": "Generate an image of a modern building as a cyberpunk-style futuristic structure with neon lights and holographic elements"
}
]
)
print(response.choices[0].message.content)
# >>> {"url": "https://.../image.jpg"}
from vlmrun.client import VLMRun
from pydantic import BaseModel, Field
# Define the response schema
class ImageGenerationResponse(BaseModel):
url: str = Field(..., description="The URL of the generated image")
# Initialize the VLMRun client
client = VLMRun(api_key="<VLMRUN_API_KEY>")
# Generate the image with structured output
response = client.agent.completions.create(
model="vlmrun-orion-1:auto",
messages=[
{
"role": "user",
"content": "Generate an image of a modern building as a cyberpunk-style futuristic structure with neon lights and holographic elements"
}
],
response_format={"type": "json_schema", "schema": ImageGenerationResponse.model_json_schema()}
)
# Validate the response
result = ImageGenerationResponse.model_validate_json(response.choices[0].message.content)
# >>> ImageGenerationResponse(url="https://.../image.jpg")
import { VlmRun } from "vlmrun";
const client = new VlmRun({
apiKey: "<VLMRUN_API_KEY>",
baseURL: "https://api.vlm.run/v1"
});
const response = await client.agent.completions.create({
model: "vlmrun-orion-1:auto",
messages: [
{
role: "user",
content: "Generate an image of a modern building as a cyberpunk-style futuristic structure with neon lights and holographic elements"
}
]
});
console.log(response.choices[0].message.content);
import { VlmRun } from "vlmrun";
import { z } from "zod";
import { zodToJsonSchema } from "zod-to-json-schema";
// Define the response schema with Zod
const ImageGenerationResponseSchema = z.object({
url: z.string().describe("The URL of the generated image")
});
// Initialize the VLMRun client
const client = new VlmRun({
apiKey: "<VLMRUN_API_KEY>",
baseURL: "https://api.vlm.run/v1"
});
// Generate the image with structured output
const response = await client.agent.completions.create({
model: "vlmrun-orion-1:auto",
messages: [
{
role: "user",
content: "Generate an image of a modern building as a cyberpunk-style futuristic structure with neon lights and holographic elements"
}
],
response_format: {
type: "json_schema",
schema: zodToJsonSchema(ImageGenerationResponseSchema)
}
});
const result = ImageGenerationResponseSchema.parse(JSON.parse(response.choices[0].message.content));
Image-to-Image
The original structure stays.
Image-to-image result.
Reference Dog Image

Dog flying through space

Image inputs.
from vlmrun.client import VLMRun
# Initialize the VLMRun client
client = VLMRun(api_key="<VLMRUN_API_KEY>")
# Generate the image
response = client.agent.completions.create(
model="vlmrun-orion-1:auto",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Transform the image of my dog on the right into a flying dog with superman cape, with majestic background"},
{"type": "image_url", "image_url": {"url": "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/image.object-detection/dog-cat.jpg", "detail": "auto"}}
]
}
]
)
print(response.choices[0].message.content)
# >>> {"url": "https://.../image.jpg"}
from vlmrun.client import VLMRun
from pydantic import BaseModel, Field
# Define the response schema
class ImageGenerationResponse(BaseModel):
url: str = Field(..., description="The URL of the generated image")
# Initialize the VLMRun client
client = VLMRun(api_key="<VLMRUN_API_KEY>")
# Transform the image with structured output
response = client.agent.completions.create(
model="vlmrun-orion-1:auto",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Transform the image of my dog on the right into a flying dog with superman cape, with majestic background"},
{"type": "image_url", "image_url": {"url": "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/image.object-detection/dog-cat.jpg", "detail": "auto"}}
]
}
],
response_format={"type": "json_schema", "schema": ImageGenerationResponse.model_json_schema()}
)
# Validate the response
result = ImageGenerationResponse.model_validate_json(response.choices[0].message.content)
import { VlmRun } from "vlmrun";
const client = new VlmRun({
apiKey: "<VLMRUN_API_KEY>",
baseURL: "https://api.vlm.run/v1"
});
const response = await client.agent.completions.create({
model: "vlmrun-orion-1:auto",
messages: [
{
role: "user",
content: [
{ type: "text", text: "Transform the image of my dog on the right into a flying dog with superman cape, with majestic background" },
{ type: "image_url", image_url: { url: "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/image.object-detection/dog-cat.jpg", detail: "auto" } }
]
}
]
});
console.log(response.choices[0].message.content);
import { VlmRun } from "vlmrun";
import { z } from "zod";
import { zodToJsonSchema } from "zod-to-json-schema";
// Define the response schema with Zod
const ImageGenerationResponseSchema = z.object({
url: z.string().describe("The URL of the generated image")
});
// Initialize the VLMRun client
const client = new VlmRun({
apiKey: "<VLMRUN_API_KEY>",
baseURL: "https://api.vlm.run/v1"
});
// Transform the image with structured output
const response = await client.agent.completions.create({
model: "vlmrun-orion-1:auto",
messages: [
{
role: "user",
content: [
{ type: "text", text: "Transform the image of my dog on the right into a flying dog with superman cape, with majestic background" },
{ type: "image_url", image_url: { url: "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/image.object-detection/dog-cat.jpg", detail: "auto" } }
]
}
],
response_format: {
type: "json_schema",
schema: zodToJsonSchema(ImageGenerationResponseSchema)
}
});
const result = ImageGenerationResponseSchema.parse(JSON.parse(response.choices[0].message.content));
Image Inpainting
Fill a missing area, remove an object, or add an element.
Inpainting result.
Reference Dog Image

Reference Car Image

Image inputs.
from vlmrun.client import VLMRun
# Initialize the VLMRun client
client = VLMRun(api_key="<VLMRUN_API_KEY>")
# Generate the image
response = client.agent.completions.create(
model="vlmrun-orion-1:auto",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Given two images: the first with a dog in front holding a yellow ball, inpaint her driving the car shown in the second image."},
{"type": "image_url", "image_url": {"url": "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/image.object-detection/dogs.jpg", "detail": "auto"}},
{"type": "image_url", "image_url": {"url": "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/image.caption/car.jpg", "detail": "auto"}}
]
}
]
)
print(response.choices[0].message.content)
# >>> {"url": "https://.../image.jpg"}
from vlmrun.client import VLMRun
from pydantic import BaseModel, Field
# Define the response schema
class ImageGenerationResponse(BaseModel):
url: str = Field(..., description="The URL of the generated image")
# Initialize the VLMRun client
client = VLMRun(api_key="<VLMRUN_API_KEY>")
# Inpaint the image with structured output
response = client.agent.completions.create(
model="vlmrun-orion-1:auto",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Given two images: the first with a dog in front holding a yellow ball, inpaint her driving the car shown in the second image."},
{"type": "image_url", "image_url": {"url": "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/image.object-detection/dogs.jpg", "detail": "auto"}},
{"type": "image_url", "image_url": {"url": "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/image.caption/car.jpg", "detail": "auto"}}
]
}
],
response_format={"type": "json_schema", "schema": ImageGenerationResponse.model_json_schema()}
)
# Validate the response
result = ImageGenerationResponse.model_validate_json(response.choices[0].message.content)
import { VlmRun } from "vlmrun";
const client = new VlmRun({
apiKey: "<VLMRUN_API_KEY>",
baseURL: "https://api.vlm.run/v1"
});
const response = await client.agent.completions.create({
model: "vlmrun-orion-1:auto",
messages: [
{
role: "user",
content: [
{ type: "text", text: "Given two images: the first with a dog in front holding a yellow ball, inpaint her driving the car shown in the second image." },
{ type: "image_url", image_url: { url: "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/image.object-detection/dogs.jpg", detail: "auto" } },
{ type: "image_url", image_url: { url: "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/image.caption/car.jpg", detail: "auto" } }
]
}
]
});
console.log(response.choices[0].message.content);
import { VlmRun } from "vlmrun";
import { z } from "zod";
import { zodToJsonSchema } from "zod-to-json-schema";
// Define the response schema with Zod
const ImageGenerationResponseSchema = z.object({
url: z.string().describe("The URL of the generated image")
});
// Initialize the VLMRun client
const client = new VlmRun({
apiKey: "<VLMRUN_API_KEY>",
baseURL: "https://api.vlm.run/v1"
});
// Inpaint the image with structured output
const response = await client.agent.completions.create({
model: "vlmrun-orion-1:auto",
messages: [
{
role: "user",
content: [
{ type: "text", text: "Given two images: the first with a dog in front holding a yellow ball, inpaint her driving the car shown in the second image." },
{ type: "image_url", image_url: { url: "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/image.object-detection/dogs.jpg", detail: "auto" } },
{ type: "image_url", image_url: { url: "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/image.caption/car.jpg", detail: "auto" } }
]
}
],
response_format: {
type: "json_schema",
schema: zodToJsonSchema(ImageGenerationResponseSchema)
}
});
const result = ImageGenerationResponseSchema.parse(JSON.parse(response.choices[0].message.content));
Style Transfer
Pass a style image and a content image. The content stays.
Style transfer result.
Reference Van Gogh Image

Reference City Image

Image inputs.
from vlmrun.client import VLMRun
# Initialize the VLMRun client
client = VLMRun(api_key="<VLMRUN_API_KEY>")
# Generate the image
response = client.agent.completions.create(
model="vlmrun-orion-1:auto",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Given two images: the first with a Van Gogh painting, and the second with a city skyline at night, apply the Van Gogh painting style to the city skyline."},
{"type": "image_url", "image_url": {"url": "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/image.generation/starry-night.jpg", "detail": "auto"}},
{"type": "image_url", "image_url": {"url": "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/image.generation/sf-golden-gate.jpg", "detail": "auto"}}
]
}
]
)
print(response.choices[0].message.content)
# >>> {"url": "https://.../image.jpg"}
from vlmrun.client import VLMRun
from pydantic import BaseModel, Field
# Define the response schema
class ImageGenerationResponse(BaseModel):
url: str = Field(..., description="The URL of the generated image")
# Initialize the VLMRun client
client = VLMRun(api_key="<VLMRUN_API_KEY>")
# Apply style transfer with structured output
response = client.agent.completions.create(
model="vlmrun-orion-1:auto",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Given two images: the first with a Van Gogh painting, and the second with a city skyline at night, apply the Van Gogh painting style to the city skyline."},
{"type": "image_url", "image_url": {"url": "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/image.generation/starry-night.jpg", "detail": "auto"}},
{"type": "image_url", "image_url": {"url": "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/image.generation/sf-golden-gate.jpg", "detail": "auto"}}
]
}
],
response_format={"type": "json_schema", "schema": ImageGenerationResponse.model_json_schema()}
)
# Validate the response
result = ImageGenerationResponse.model_validate_json(response.choices[0].message.content)
import { VlmRun } from "vlmrun";
const client = new VlmRun({
apiKey: "<VLMRUN_API_KEY>",
baseURL: "https://api.vlm.run/v1"
});
const response = await client.agent.completions.create({
model: "vlmrun-orion-1:auto",
messages: [
{
role: "user",
content: [
{ type: "text", text: "Given two images: the first with a Van Gogh painting, and the second with a city skyline at night, apply the Van Gogh painting style to the city skyline." },
{ type: "image_url", image_url: { url: "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/image.generation/starry-night.jpg", detail: "auto" } },
{ type: "image_url", image_url: { url: "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/image.generation/sf-golden-gate.jpg", detail: "auto" } }
]
}
]
});
console.log(response.choices[0].message.content);
import { VlmRun } from "vlmrun";
import { z } from "zod";
import { zodToJsonSchema } from "zod-to-json-schema";
// Define the response schema with Zod
const ImageGenerationResponseSchema = z.object({
url: z.string().describe("The URL of the generated image")
});
// Initialize the VLMRun client
const client = new VlmRun({
apiKey: "<VLMRUN_API_KEY>",
baseURL: "https://api.vlm.run/v1"
});
// Apply style transfer with structured output
const response = await client.agent.completions.create({
model: "vlmrun-orion-1:auto",
messages: [
{
role: "user",
content: [
{ type: "text", text: "Given two images: the first with a Van Gogh painting, and the second with a city skyline at night, apply the Van Gogh painting style to the city skyline." },
{ type: "image_url", image_url: { url: "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/image.generation/starry-night.jpg", detail: "auto" } },
{ type: "image_url", image_url: { url: "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/image.generation/sf-golden-gate.jpg", detail: "auto" } }
]
}
],
response_format: {
type: "json_schema",
schema: zodToJsonSchema(ImageGenerationResponseSchema)
}
});
const result = ImageGenerationResponseSchema.parse(JSON.parse(response.choices[0].message.content));
FAQ
Supported styles
Supported styles
- Photorealistic: Ultra-realistic, fine detail
- High Detail: Ultra-realistic, fine detail
- Natural Lighting: Realistic light and shadow
- Professional Quality: Commercial use
- Multiple Subjects: People, objects, landscapes, architecture
Prompt tips
Prompt tips
- Be Specific: Style, composition, lighting, and mood
- Use Keywords: Art terms and techniques
- Reference Styles: An artist, movement, or visual style
- Technical Details: Resolution, quality, and output format