Back to articles
Turn Any Photo into Ghibli Art for Free with Python (3 Lines)

Turn Any Photo into Ghibli Art for Free with Python (3 Lines)

via Dev.to PythonAI Engine

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 RapidAP

Continue reading on Dev.to Python

Opens in a new tab

Read Full Article
2 views

Related Articles