Ghiblify Images Image to Image

fal-ai/ghiblify
Reimagine and transform your ordinary photos into enchanting Studio Ghibli style artwork
Inference
Commercial use

Input

Additional Settings

Customize your input with more control.

Result

Idle

Waiting for your input...

Your request will cost $0.05 per image.

Logs

Readme

Ghiblify: Transform Images into Studio Ghibli-Style Artwork

Transform your photos into enchanting Studio Ghibli-inspired artwork with Ghiblify, a specialized AI model that captures the distinctive aesthetic of acclaimed Japanese animation. Perfect for creators, developers, and animation enthusiasts looking to add magical charm to their images.

Overview

Ghiblify leverages advanced machine learning to analyze and transform regular photographs into artwork that embodies the beloved Studio Ghibli style. The model understands lighting, composition, and artistic elements characteristic of Ghibli films, delivering consistent and high-quality transformations.

Key Features

Transform any image with the distinctive characteristics of Studio Ghibli animation:

  • Soft, painterly textures and lighting
  • Characteristic color palettes inspired by Ghibli films
  • Preservation of original image composition while adding artistic elements
  • Fast processing with reliable results
  • Simple API integration with minimal configuration

Getting Started

Setting up Ghiblify is straightforward. First, install your preferred client library:

For JavaScript/TypeScript:

npm install --save @fal-ai/client

For Python:

pip install fal-client

Authentication

Configure your API key before making requests:

JavaScript:

import { fal } from "@fal-ai/client";
fal.config({
  credentials: "YOUR_FAL_KEY_HERE"
});

Python:

import fal_client as fal
import os
os.environ["FAL_KEY"] = "YOUR_FAL_KEY_HERE"

Basic Usage

Here's how to transform an image using Ghiblify:

JavaScript:

import { fal } from "@fal-ai/client";

const result = await fal.subscribe("fal-ai/ghiblify", {
  input: {
    image_url: "https://your-image-url.com/photo.jpg"
  }
});

console.log(result.data.image.url);

Python:

import fal_client as fal

result = fal.subscribe("fal-ai/ghiblify", {
    "image_url": "https://your-image-url.com/photo.jpg"
})

print(result.image.url)

API Parameters

Input Parameters

  • image_url (required): The URL of the image to transform into Ghibli style
  • seed (optional): Seed for reproducible results. If not provided, a random seed will be used
  • enable_safety_checker (optional): Whether to enable content safety checking (default: true)

Output Format

{
  "image": {
    "url": "https://generated-image-url.com/image.png",
    "content_type": "image/png",
    "file_name": "ghiblified_image.png",
    "file_size": 4404019,
    "width": 1024,
    "height": 1024
  }
}

File Handling

Ghiblify supports multiple input methods:

URL Input

input: {
  image_url: "https://publicly-accessible-image.com/image.jpg"
}

Base64 Data URI

input: {
  image_url: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQ..."
}

File Upload via fal Storage

const file = new File([imageData], "image.jpg", { type: "image/jpeg" });
const url = await fal.storage.upload(file);

const result = await fal.subscribe("fal-ai/ghiblify", {
  input: {
    image_url: url
  }
});

Queue Management

For production applications, use the queue API:

// Submit request
const { request_id } = await fal.queue.submit("fal-ai/ghiblify", {
  input: {
    image_url: "https://your-image-url.com/photo.jpg"
  },
  webhookUrl: "https://your-webhook-endpoint.com/results"
});

// Check status
const status = await fal.queue.status("fal-ai/ghiblify", {
  requestId: request_id,
  logs: true
});

// Get result when complete
const result = await fal.queue.result("fal-ai/ghiblify", {
  requestId: request_id
});

Best Practices

Make the most of Ghiblify with these recommended practices:

  • Image Quality: Use high-resolution input images for better transformations
  • Supported Formats: Accepted file types include jpg, jpeg, png, webp, gif, avif
  • Reproducible Results: Use the seed parameter for consistent outputs
  • Error Handling: Implement proper try-catch blocks for network issues
  • API Key Security: Never expose your FAL_KEY in client-side code
try {
  const result = await fal.subscribe("fal-ai/ghiblify", {
    input: {
      image_url: "your-image-url-here"
    }
  });
  // Process successful result
} catch (error) {
  console.error("Generation failed:", error);
  // Handle error appropriately
}

Advanced Usage

For production applications, implement these recommended patterns:

Cache results when possible to optimize performance and costs:

const cache = new Map();

async function getGhiblifiedImage(imageUrl) {
  const cacheKey = imageUrl;
  
  if (cache.has(cacheKey)) {
    return cache.get(cacheKey);
  }
  
  const result = await fal.subscribe("fal-ai/ghiblify", {
    input: { image_url: imageUrl }
  });
  
  cache.set(cacheKey, result);
  return result;
}

Technical Specifications

Performance characteristics:

  • Input: Single image via URL or base64 data URI
  • Output: PNG format image (typically 1024x1024 pixels)
  • Processing: Image-to-image transformation
  • Safety: Built-in content safety checker

Troubleshooting

Common issues and solutions:

Authentication errors:

  • Verify your API key is correctly set
  • Check your account status and quota
  • Ensure your key has the necessary permissions

Generation failures:

  • Validate input image URL accessibility
  • Check input image format compatibility
  • Review API response codes for specific error details

Pricing and Usage

  • Cost: $0.05 per image transformation
  • Commercial Use: Generated content can be used commercially
  • Billing: Pay only for successful generations

For detailed pricing information, visit fal.ai/pricing or contact sales for enterprise solutions.

Support and Resources

Get help and learn more:

Start transforming your images into Ghibli-style artwork today with Ghiblify. Create your API key and explore the possibilities of this unique artistic AI model.