Studio Ghibli's art style has taken over social media. The hand-drawn look, the soft colors, the dreamy landscapes. Everyone wants their photos to look like a frame from Spirited Away.
Most tutorials tell you to install PyTorch, download a 2GB model, and fight with CUDA drivers. Not necessary. With an API, you can do it in 3 lines of Python, for free.
The Result
The Code
import requests
response = requests.post(
"https://phototoanime1.p.rapidapi.com/ghibli",
headers={"x-rapidapi-key": "YOUR_API_KEY", "x-rapidapi-host": "phototoanime1.p.rapidapi.com"},
files={"image": open("my_photo.jpg", "rb")},
)
print(response.json()["image_url"])
The response:
{
"image_url": "https://images.ai-engine.net/photo-to-anime-ai/abc123.jpg",
"width": 640,
"height": 960,
"size_bytes": 126722
}
Open the URL and you have your Ghibli art. No PyTorch, no CUDA, no model file.
What You Need
- Python with
requests(pip install requests) - A free API key from RapidAPI
- A photo (JPEG, PNG, or WebP, up to 10MB)
The free tier gives you 50 transformations per month. No credit card.
Download the Result
image_data = requests.get(result["image_url"]).content
with open("ghibli_output.jpg", "wb") as f:
f.write(image_data)
You Can Also Use a URL
response = requests.post(
"https://phototoanime1.p.rapidapi.com/ghibli",
headers={**HEADERS, "Content-Type": "application/x-www-form-urlencoded"},
data={"url": "https://example.com/my_photo.jpg"},
)
API vs Local Model
| Local Model | Ghibli API | |
|---|---|---|
| Setup | PyTorch + 2GB model | pip install requests |
| GPU | Required | Not needed |
| Code | 20-30 lines | 3 lines |
| Cost | Free (need GPU hardware) | Free (50/month) |
| Quality | Depends on model | Face-aware with background blending |
7 Other Styles
The same API also offers 7 cartoon styles via /cartoonize: anime, 3d, handdrawn, sketch, artstyle, design, illustration.
response = requests.post(
"https://phototoanime1.p.rapidapi.com/cartoonize",
headers=HEADERS,
files={"image": open("photo.jpg", "rb")},
data={"style": "anime"},
)
Tips
- Use clear, well-lit portraits for best results
- Front-facing photos work best
- The API handles up to 10MB images

Top comments (0)