Create Stunning Images with the jiht76/mindyflux Cognitive Actions

22 Apr 2025
Create Stunning Images with the jiht76/mindyflux Cognitive Actions

In the ever-evolving world of AI and image generation, the jiht76/mindyflux Cognitive Actions offer a powerful way to create custom inpainted images. With the ability to leverage specific models and prompts, developers can generate high-quality images tailored to their specific needs. These pre-built actions simplify the integration process, allowing you to focus on creativity and application functionality rather than the complexities of image generation algorithms.

Prerequisites

Before you dive into using the jiht76/mindyflux Cognitive Actions, ensure that you have the following:

  • An API key for the Cognitive Actions platform, which will allow you to authenticate your requests.
  • A basic understanding of how to make HTTP requests (using tools like requests in Python).

Authentication typically involves passing your API key in the request headers, allowing you to securely access the action endpoints.

Cognitive Actions Overview

Generate Custom Inpainted Image

The Generate Custom Inpainted Image action enables you to create customized images based on your specific prompts and models. It supports image inpainting using masks, allowing for a variety of outputs in different formats and qualities.

Input

The input for this action is a JSON object that includes the following required and optional fields:

  • Required:
    • prompt: A descriptive text prompt for the image generation.
  • Optional:
    • mask: Specifies an image mask for inpainting mode (URI format).
    • seed: Integer seed for reproducibility.
    • image: URI for the input image (overrides width/height if provided).
    • width: Desired output image width (between 256 and 1440).
    • height: Desired output image height (between 256 and 1440).
    • goFast: Boolean to enable faster predictions.
    • aspectRatio: Defines the aspect ratio of the output image.
    • numOutputs: Number of generated images (1 to 4).
    • outputFormat: Format of the output image (webp, jpg, png).
    • guidanceScale: Scale for guiding the diffusion process (0 to 10).
    • outputQuality: Quality of the output image (0 to 100).
    • inferenceModel: Model selection for inference (dev or schnell).
    • Additional parameters like extraLora, extraLoraScale, and more.

Example Input:

{
  "prompt": "(((A very close up photo of MINDYFLUX solid background))), very detailed eyes , laptop, cinematic shot, ((looking at the camera)), quirk smile, with a full mechanical plastic body, close up medium brown hair, white plastic metal armor mechanic body suit, robot body, android body, neon body, solid background, mechanical arms, mechanical shoulders, neon cables, mechanical body, full mechanical arms, mechanical interior, mechanical bones, mechanical neon light, neon interior, mechanical details",
  "loraScale": 1,
  "numOutputs": 1,
  "aspectRatio": "1:1",
  "outputFormat": "webp",
  "guidanceScale": 3.5,
  "outputQuality": 80,
  "extraLoraScale": 0.8,
  "inferenceModel": "dev",
  "numInferenceSteps": 28
}

Output

When you successfully execute this action, you will receive a response containing the generated image(s). The output will typically be a URL pointing to the generated image.

Example Output:

[
  "https://assets.cognitiveactions.com/invocations/a5d0a7a1-2070-4766-a7e0-2408fdbea87a/17a27282-e99c-4a17-8972-fd7ec2454b4f.webp"
]

Conceptual Usage Example (Python)

Here’s how you might call the Generate Custom Inpainted Image action using Python:

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 = "f4f43c9d-e15c-4f1f-8ceb-ff0c14c82cf0"  # Action ID for Generate Custom Inpainted Image

# Construct the input payload based on the action's requirements
payload = {
    "prompt": "(((A very close up photo of MINDYFLUX solid background))), very detailed eyes , laptop, cinematic shot, ((looking at the camera)), quirk smile, with a full mechanical plastic body, close up medium brown hair, white plastic metal armor mechanic body suit, robot body, android body, neon body, solid background, mechanical arms, mechanical shoulders, neon cables, mechanical body, full mechanical arms, mechanical interior, mechanical bones, mechanical neon light, neon interior, mechanical details",
    "loraScale": 1,
    "numOutputs": 1,
    "aspectRatio": "1:1",
    "outputFormat": "webp",
    "guidanceScale": 3.5,
    "outputQuality": 80,
    "extraLoraScale": 0.8,
    "inferenceModel": "dev",
    "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 the placeholders with your actual API key and endpoint. The action ID corresponds to the Generate Custom Inpainted Image, and the input payload is structured according to the action's requirements.

Conclusion

The jiht76/mindyflux Cognitive Actions empower developers to harness the power of AI for image generation, making it easier to create stunning visuals tailored to specific requirements. By utilizing the Generate Custom Inpainted Image action, you can streamline your image creation process and explore endless creative possibilities. Whether you're developing an application, enhancing a game, or simply experimenting with AI, these actions can provide tremendous value. Start integrating today and unleash your creativity!