Create Stunning 2D Animated Images with Joaquim Cognitive Actions

24 Apr 2025
Create Stunning 2D Animated Images with Joaquim Cognitive Actions

In the world of creative applications, generating captivating images can be a game-changer. The vcollos/joaquim Cognitive Actions enable developers to create unique 2D animated-style images featuring a character named Joaquim. By leveraging advanced features such as image inpainting and customizable output formats, these actions provide a robust toolkit for image generation. Whether you are building an app that requires artistic imagery or simply want to experiment with creative generation, these pre-built actions offer a seamless integration experience.

Prerequisites

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

  • An API key for the Cognitive Actions platform, which will be used to authenticate your requests.
  • Basic knowledge of JSON structures, as the actions will require you to format your input and handle output accordingly.

Authentication typically involves passing your API key in the request headers. For example:

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

Cognitive Actions Overview

Generate Image With Joaquim

Description: This action allows you to create 2D animated-style images featuring Joaquim. You can customize outputs with various features, including image inpainting, different models for processing speed, and detailed settings for image dimensions and quality.

Category: image-generation

Input

The input schema for this action requires a prompt and allows for several optional parameters to customize the image generation process. Below is a breakdown of the key fields:

  • prompt (required): Describes the scene you want to create. For example, "Joaquim is a kid boy in the African savannah with his friends, a meerkat and a wild boar, representing the scene of the Disney lion king cartoon, with all the characteristics of 2d animation, professional drawing, 2d cinema."
  • goFast: A boolean to enable faster predictions (default: false).
  • loraScale: A number to set the intensity for applying the main LoRA (default: 1).
  • numOutputs: Specifies how many images to generate (default: 1).
  • aspectRatio: The aspect ratio of the output image (default: "1:1").
  • outputFormat: The format of the output image (default: "webp").
  • guidanceScale: Controls the strength of guidance during generation (default: 3).
  • outputQuality: Specifies the quality for output images (default: 80).

Example Input:

{
  "goFast": false,
  "prompt": "Joaquim is a kid boy in the African savannah with his friends, a meerkat and a wild boar, representing the scene of the Disney lion king cartoon, with all the characteristics of 2d animation, professional drawing, 2d cinema",
  "loraScale": 1,
  "numOutputs": 1,
  "aspectRatio": "1:1",
  "outputFormat": "webp",
  "guidanceScale": 3,
  "outputQuality": 80,
  "extraLoraScale": 1,
  "inferenceModel": "dev",
  "promptStrength": 0.8,
  "imageMegapixels": "1",
  "numInferenceSteps": 28
}

Output

The output will typically return an array of URLs pointing to the generated images. Here’s an example output:

Example Output:

[
  "https://assets.cognitiveactions.com/invocations/2f4871b7-015f-45a7-9e3f-2ee4ca1c36c3/40e6d9c7-903d-4ded-874f-839b8cfea647.webp"
]

Conceptual Usage Example (Python)

Here’s how you might call the Generate Image With Joaquim action using a conceptual Python code snippet:

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 = "6d7f3515-5662-4b32-9446-0612064a833e" # Action ID for Generate Image With Joaquim

# Construct the input payload based on the action's requirements
payload = {
    "goFast": false,
    "prompt": "Joaquim is a kid boy in the African savannah with his friends, a meerkat and a wild boar, representing the scene of the Disney lion king cartoon, with all the characteristics of 2d animation, professional drawing, 2d cinema",
    "loraScale": 1,
    "numOutputs": 1,
    "aspectRatio": "1:1",
    "outputFormat": "webp",
    "guidanceScale": 3,
    "outputQuality": 80,
    "extraLoraScale": 1,
    "inferenceModel": "dev",
    "promptStrength": 0.8,
    "imageMegapixels": "1",
    "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}")

Explanation of the Python Code Snippet

In the provided code snippet, replace YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key. The action_id is set to the ID for the Generate Image With Joaquim action. The payload is constructed with the required and optional fields based on the action's specifications. The request is sent to a hypothetical endpoint, and the response is printed, showing the generated image URLs.

Conclusion

The vcollos/joaquim Cognitive Actions empower developers to generate stunning 2D animated images with ease. By understanding the input requirements and leveraging the capabilities of these actions, you can create unique visual content for your applications. Explore further by integrating this action into your projects, customizing prompts, and experimenting with different settings to suit your creative needs!