Create Stunning Art with Miyazaki Watercolor Style Using Cognitive Actions

22 Apr 2025
Create Stunning Art with Miyazaki Watercolor Style Using Cognitive Actions

Integrating art into applications has never been easier with the koratkar/miyazaki-watercolor Cognitive Actions. This powerful API allows developers to generate images inspired by the enchanting watercolor sketches of Hayao Miyazaki. With a variety of customizable parameters, you can create unique artworks tailored to your specifications. Let’s explore how to harness these capabilities in your applications.

Prerequisites

To get started with Cognitive Actions, you'll need:

  • An API key for the Cognitive Actions platform to authenticate your requests.
  • Basic knowledge of JSON and API calls to interact with the service effectively.

Typically, authentication is handled by passing your API key in the headers of your requests.

Cognitive Actions Overview

Generate Miyazaki Watercolor Style Image

This action allows you to create images that capture the whimsical essence of Hayao Miyazaki’s watercolor art. It offers flexibility in customizing aspects such as resolution, aspect ratio, and more.

Input

The input for this action requires a JSON object with the following fields:

  • prompt (required): A text description guiding the image generation.
  • loraScale: Multiplier for the intensity of the main LoRA application.
  • modelType: Specifies which model to use for inference (either "dev" or "schnell").
  • numOutputs: The number of images to generate (1-4).
  • guidanceScale: Scale for guiding the diffusion process.
  • outputQuality: Quality setting for output images on a scale of 0 to 100.
  • extraLoraScale: Adjusts the strength of any extra LoRA application.
  • imageAspectRatio: Defines the image's aspect ratio.
  • imageOutputFormat: Specifies the output image file format.
  • numInferenceSteps: Sets the number of denoising steps to perform.

Here’s an example input payload:

{
  "prompt": "depiction of a dissolution and disassociation within a consciousness that cannot make anything of sensory data in the style of Hayao Miyazaki's watercolor sketches (MYZKSKETCH)",
  "loraScale": 1,
  "modelType": "dev",
  "numOutputs": 1,
  "guidanceScale": 3.5,
  "outputQuality": 80,
  "extraLoraScale": 0.8,
  "imageAspectRatio": "1:1",
  "imageOutputFormat": "webp",
  "numInferenceSteps": 28
}

Output

The output of this action is a URL pointing to the generated image. Here’s an example of a typical output:

[
  "https://assets.cognitiveactions.com/invocations/c2ccd569-c896-400d-9249-e9071cba5f37/3b72bfb9-0ed5-43b0-b05d-1012f196d145.webp"
]

Conceptual Usage Example (Python)

Below is a conceptual Python code snippet that demonstrates how you might invoke the Generate Miyazaki Watercolor Style Image action:

import requests
import json

# Replace with your Cognitive Actions API key and endpoint
COGNITIVE_ACTIONS_API_KEY = "YOUR_COGNITIVE_ACTIONS_API_KEY"
COGNITIVE_ACTIONS_EXECUTE_URL = "https://api.cognitiveactions.com/actions/execute"  # Hypothetical endpoint

action_id = "4a3c242f-f7dd-40e9-800d-e505827f3125"  # Action ID for Generate Miyazaki Watercolor Style Image

# Construct the input payload based on the action's requirements
payload = {
    "prompt": "depiction of a dissolution and disassociation within a consciousness that cannot make anything of sensory data in the style of Hayao Miyazaki's watercolor sketches (MYZKSKETCH)",
    "loraScale": 1,
    "modelType": "dev",
    "numOutputs": 1,
    "guidanceScale": 3.5,
    "outputQuality": 80,
    "extraLoraScale": 0.8,
    "imageAspectRatio": "1:1",
    "imageOutputFormat": "webp",
    "numInferenceSteps": 28
}

headers = {
    "Authorization": f"Bearer {COGNITIVE_ACTIONS_API_KEY}",
    "Content-Type": "application/json"
}

try:
    response = requests.post(
        COGNITIVE_ACTIONS_EXECUTE_URL,
        headers=headers,
        json={"action_id": action_id, "inputs": payload}  # Hypothetical structure
    )
    response.raise_for_status()  # Raise an exception for bad status codes (4xx or 5xx)

    result = response.json()
    print("Action executed successfully:")
    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: {e.response.text}")

In this code snippet:

  • Replace YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key.
  • The payload variable contains the input parameters based on the required structure.
  • The action_id is set to the ID of the action you are executing.

Conclusion

With the koratkar/miyazaki-watercolor Cognitive Actions, developers can easily create beautiful, customized artwork in the iconic style of Hayao Miyazaki. By leveraging the input parameters, you can tailor the output to suit various creative needs. Start experimenting with these actions today and bring a touch of artistry to your applications!