Transform Your Images into Ghibli Art with Ghiblify 3

26 Apr 2025
Transform Your Images into Ghibli Art with Ghiblify 3

Ghiblify 3 is an innovative service that allows developers to generate enchanting images in the iconic Ghibli art style. By leveraging advanced image generation techniques, Ghiblify 3 enables users to create stunning artwork effortlessly, whether from existing images or through inpainting methods. This service simplifies the creative process, providing quick and high-quality outputs tailored to your specifications.

Common use cases for Ghiblify 3 include enhancing digital art projects, creating unique visual content for marketing, or simply adding a touch of whimsy to personal collections. Whether you're an artist looking to explore new styles, a developer building a creative application, or a business aiming to captivate audiences, Ghiblify 3 offers the tools to transform your visions into reality.

To get started, you'll need a Cognitive Actions API key and a basic understanding of making API calls.

Generate Ghibli Style Image

The "Generate Ghibli Style Image" action allows you to create images in the beloved Ghibli art style. This action can transform standard images into whimsical, animated-like artworks, making it an excellent choice for those looking to add a unique flair to their visual content.

Input Requirements

To use this action, you must provide a JSON object that includes several properties:

  • prompt: A text prompt describing the desired image. For instance, "recreate this image in Ghibli style."
  • image: A URI to the input image you wish to transform.
  • model: Choose between "dev" for detailed results or "schnell" for faster processing.
  • aspectRatio, width, height: These parameters help define the dimensions and aspect ratio of the output image.
  • numOutputs: Specify how many images to generate.
  • outputFormat: Choose the format for the output image (e.g., jpg, png).
  • Additional parameters such as guidanceScale, numInferenceSteps, and promptStrength allow for fine-tuning the generation process.

Expected Output

The expected output will be a URI to the generated Ghibli-style image, which you can then use in your applications or projects.

Use Cases for this specific action

  1. Artistic Projects: Artists can use this action to transform their sketches or photos into Ghibli-style artworks, adding a new dimension to their portfolios.
  2. Content Creation: Marketers and content creators can generate unique visuals for social media, blogs, or advertisements that stand out and engage audiences.
  3. Game Development: Developers can create character designs or backgrounds inspired by the Ghibli aesthetic, enriching the visual storytelling of their games.
  4. Personal Use: Individuals can create personalized gifts or keepsakes by transforming family photos into enchanting Ghibli-style images.
import requests
import json

# Replace with your actual Cognitive Actions API key and endpoint
# Ensure your environment securely handles the API key
COGNITIVE_ACTIONS_API_KEY = "YOUR_COGNITIVE_ACTIONS_API_KEY"
# This endpoint URL is hypothetical and should be documented for users
COGNITIVE_ACTIONS_EXECUTE_URL = "https://api.cognitiveactions.com/actions/execute"

action_id = "bbbc6460-6799-4ec0-9bbe-9ed0150ecaa1" # Action ID for: Generate Ghibli Style Image

# Construct the exact input payload based on the action's requirements
# This example uses the predefined example_input for this action:
payload = {
  "image": "https://replicate.delivery/pbxt/MjHnCeigi2OkaZhw7UT15ObrxJUzZqjsrM2or8OJJNWvEAYZ/image%202.png",
  "model": "dev",
  "goFast": false,
  "prompt": "recreate this image in ghibli style",
  "loraScale": 0.85,
  "megapixels": "1",
  "numOutputs": 1,
  "aspectRatio": "1:1",
  "outputFormat": "jpg",
  "guidanceScale": 3,
  "outputQuality": 100,
  "extraLoraScale": 1,
  "promptStrength": 0.7,
  "numInferenceSteps": 28
}

headers = {
    "Authorization": f"Bearer {COGNITIVE_ACTIONS_API_KEY}",
    "Content-Type": "application/json",
    # Add any other required headers for the Cognitive Actions API
}

# Prepare the request body for the hypothetical execution endpoint
request_body = {
    "action_id": action_id,
    "inputs": payload
}

print(f"--- Calling Cognitive Action: {action.name or action_id} ---")
print(f"Endpoint: {COGNITIVE_ACTIONS_EXECUTE_URL}")
print(f"Action ID: {action_id}")
print("Payload being sent:")
print(json.dumps(request_body, indent=2))
print("------------------------------------------------")

try:
    response = requests.post(
        COGNITIVE_ACTIONS_EXECUTE_URL,
        headers=headers,
        json=request_body
    )
    response.raise_for_status() # Raise an exception for bad status codes (4xx or 5xx)

    result = response.json()
    print("Action executed successfully. Result:")
    print(json.dumps(result, indent=2))

except requests.exceptions.RequestException as e:
    print(f"Error executing action {action_id}: {e}")
    if e.response is not None:
        print(f"Response status: {e.response.status_code}")
        try:
            print(f"Response body: {e.response.json()}")
        except json.JSONDecodeError:
            print(f"Response body (non-JSON): {e.response.text}")
    print("------------------------------------------------")

Conclusion

Ghiblify 3 opens new avenues for creativity by allowing developers to generate stunning Ghibli-style images effortlessly. With its versatile input options and high-quality outputs, this service can cater to a wide range of artistic and commercial needs. Whether you are looking to enhance your creative projects, engage your audience with captivating visuals, or simply explore the magical world of Ghibli art, Ghiblify 3 provides the tools you need to bring your ideas to life. Start experimenting with Ghiblify 3 today and unlock the potential of your images!