Create Stunning Doodles with the callmejz-ai/doodle Cognitive Actions

23 Apr 2025
Create Stunning Doodles with the callmejz-ai/doodle Cognitive Actions

In the world of digital design, the ability to generate unique artistic doodles can set an application apart. The callmejz-ai/doodle API offers a powerful Cognitive Action that allows developers to harness AI-driven image generation techniques to create stylized doodles from basic line drawings. This capability is particularly beneficial for luxury brands and B2B marketing by enhancing the aesthetic appeal of visual content.

Prerequisites

Before diving into the integration of the callmejz-ai/doodle Cognitive Actions, ensure that you have the following:

  • An API key for accessing the Cognitive Actions platform.
  • Basic understanding of JSON and RESTful APIs.
  • Familiarity with making HTTP requests using libraries such as requests in Python.

For authentication, you'll typically pass your API key in the headers of your requests, which will grant you access to the various actions available in the API.

Cognitive Actions Overview

Generate Artistic Doodles

The Generate Artistic Doodles action allows you to create stylized doodles based on initial black line drawings, fashion illustrations, or wire sculptures. This action uses advanced AI techniques such as img2img and inpainting to enhance the complexity and intellectual appeal of the generated images.

Category: Image Generation

Input

The input for this action requires a structured JSON payload with several parameters. Below is the schema along with an example input:

{
  "width": 1024,
  "height": 1024,
  "prompt": "flower",
  "refine": "no_refiner",
  "loraScale": 0.6,
  "scheduler": "K_EULER",
  "guidanceScale": 7.5,
  "applyWatermark": true,
  "negativePrompt": "",
  "promptStrength": 0.8,
  "numberOfOutputs": 1,
  "highNoiseFraction": 0.8,
  "numberOfInferenceSteps": 50
}
  • width (integer): Specifies the width of the output image. Default is 1024.
  • height (integer): Specifies the height of the output image. Default is 1024.
  • prompt (string): Text prompt guiding the image generation (e.g., "flower").
  • refine (string): Style for refining the generated image (default: "no_refiner").
  • loraScale (number): Scale for applying LoRA in trained models. Values range from 0 to 1.
  • scheduler (string): The type of scheduler used during image generation. Default is "K_EULER".
  • guidanceScale (number): Scale factor for classifier-free guidance (e.g., 7.5).
  • applyWatermark (boolean): If true, a watermark is applied to the generated images.
  • negativePrompt (string): Text input for negating elements in the image.
  • promptStrength (number): Influences how much the prompt affects the generated image.
  • numberOfOutputs (integer): How many images to generate (default: 1).
  • highNoiseFraction (number): Fraction of noise applied for refinement.
  • numberOfInferenceSteps (integer): Steps in the denoising process (default: 50).

Output

Upon successful execution, the action typically returns an array of URLs pointing to the generated images. Below is an example output:

[
  "https://assets.cognitiveactions.com/invocations/4eb50e5c-637d-4ee3-9d50-e5ed079ca297/4672d474-8dc3-4509-9b71-c3b473ea6212.png"
]

Conceptual Usage Example (Python)

Here’s a conceptual Python code snippet demonstrating how to invoke the Generate Artistic Doodles 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 = "a18f248e-731c-4716-af52-94febe7da637"  # Action ID for Generate Artistic Doodles

# Construct the input payload based on the action's requirements
payload = {
    "width": 1024,
    "height": 1024,
    "prompt": "flower",
    "refine": "no_refiner",
    "loraScale": 0.6,
    "scheduler": "K_EULER",
    "guidanceScale": 7.5,
    "applyWatermark": True,
    "negativePrompt": "",
    "promptStrength": 0.8,
    "numberOfOutputs": 1,
    "highNoiseFraction": 0.8,
    "numberOfInferenceSteps": 50
}

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 action_id corresponds to the Generate Artistic Doodles action.
  • The payload is structured based on the required inputs.
  • The endpoint URL and request structure are hypothetical and may differ in actual implementation.

Conclusion

The callmejz-ai/doodle Cognitive Actions provide a robust toolset for developers looking to enhance their applications with AI-generated artistic doodles. By utilizing the Generate Artistic Doodles action, you can create unique and appealing visuals that can captivate your audience. Consider experimenting with different parameters to explore the full potential of this action in your projects!