Generate Stunning Images Easily with Manmaru Mix v3 Cognitive Actions

21 Apr 2025
Generate Stunning Images Easily with Manmaru Mix v3 Cognitive Actions

In the world of artificial intelligence, the ability to generate high-quality images from textual descriptions has become a game-changer. The "dhanushreddy291/manmaru-mix-v3" API offers developers a powerful toolset called Cognitive Actions that leverages the Manmaru Mix v3.0 model from CivitAI. With these pre-built actions, developers can effortlessly create stunning visuals tailored to their unique specifications. This article will guide you through the process of integrating the image generation action into your applications.

Prerequisites

Before you start using the Cognitive Actions, ensure you have the following:

  • API Key: You will need an API key to authenticate your requests to the Cognitive Actions platform. This key will typically be passed in the headers of your requests.
  • Access to a Development Environment: Make sure you have a coding environment set up to test the API calls.

Authentication involves including your API key in the headers of your requests, ensuring that only authorized users can access the Cognitive Actions.

Cognitive Actions Overview

Generate Image with Manmaru Mix v3.0

Description: This action generates high-quality images using the Manmaru Mix v3.0 model. You can customize various parameters such as image dimensions, inference steps, and guidance for tailored results.

  • Category: Image Generation

Input

The action requires a structured input as defined in the schema. Here are the key fields:

  • seed (integer): A seed value for random number generation. Use 0 for a random seed (default: 0, max: 2147483647).
  • steps (integer): Number of inference steps, ranging from 10 to 100 (default: 20).
  • width (integer): Width of the image in pixels (default: 512, max: 1920).
  • height (integer): Height of the image in pixels (default: 728, max: 1920).
  • prompt (string): Text prompt guiding the image generation (default: "child boy, short hair, crew neck sweater, (masterpiece, best quality:1.6), ghibli, Sun in the sky, Rocky Mountain National Park, Charismatic").
  • guidance (number): Scale for image generation guidance (default: 7).
  • scheduler (string): Scheduler algorithm to use ("EulerA" or "MultistepDPM-Solver", default: "EulerA").
  • negativePrompt (string): Describes what to avoid in the image generation (default: "(worst quality, normal quality, low quality, 3D, realistic:1.6)").
  • numberOfOutputs (integer): Specifies the number of images to generate (from 1 to 4, default: 1).
Example Input
{
  "seed": 0,
  "steps": 20,
  "width": 512,
  "height": 768,
  "prompt": "child boy, short hair, crew neck sweater, (masterpiece, best quality:1.6), ghibli, Sun in the sky, Rocky Mountain National Park, Charismatic",
  "guidance": 7,
  "scheduler": "EulerA",
  "negativePrompt": "(worst quality, normal quality, low quality, 3D, realistic:1.6)",
  "numberOfOutputs": 1
}

Output

The action typically returns an array of URLs pointing to the generated images.

Example Output
[
  "https://assets.cognitiveactions.com/invocations/e9d00efa-a2ca-4d41-86cd-3f50aa8d4acf/d525b68d-9e42-4d24-ac00-e023659de9a7.png"
]

Conceptual Usage Example (Python)

Below is a conceptual Python code snippet that demonstrates how to call this action using a hypothetical Cognitive Actions endpoint:

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 = "db5546ef-5be9-4e3b-a3d5-31363220df0b" # Action ID for Generate Image with Manmaru Mix v3.0

# Construct the input payload based on the action's requirements
payload = {
    "seed": 0,
    "steps": 20,
    "width": 512,
    "height": 768,
    "prompt": "child boy, short hair, crew neck sweater, (masterpiece, best quality:1.6), ghibli, Sun in the sky, Rocky Mountain National Park, Charismatic",
    "guidance": 7,
    "scheduler": "EulerA",
    "negativePrompt": "(worst quality, normal quality, low quality, 3D, realistic:1.6)",
    "numberOfOutputs": 1
}

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 is specified for the "Generate Image with Manmaru Mix v3.0," and the input JSON payload is structured according to the required fields.

Conclusion

The Cognitive Actions provided by the "dhanushreddy291/manmaru-mix-v3" API offer developers an innovative way to generate high-quality images effortlessly. By customizing inputs such as prompts and dimensions, you can create unique visuals that meet your application's needs. Explore various use cases, from art generation to automated content creation, and leverage the power of image generation in your projects! Happy coding!