Create Stunning Images with the FitnessMe Cognitive Actions

24 Apr 2025
Create Stunning Images with the FitnessMe Cognitive Actions

Integrating AI into your applications can empower users with creative capabilities. The FitnessMe Cognitive Actions from the omniedgeio spec enable developers to generate beautiful and inspiring images, particularly focusing on fitness and confidence. This article explores how to utilize the Generate AI-Powered Gym Goddess Image action, showcasing its input requirements, output results, and practical implementation in your applications.

Prerequisites

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

  • API Key: Register for an account on the Cognitive Actions platform to obtain your API key.
  • Setup: Familiarize yourself with making HTTP requests in your preferred programming language.

Authentication typically involves passing your API key in the headers of your requests, allowing secure access to the Cognitive Actions services.

Cognitive Actions Overview

Generate AI-Powered Gym Goddess Image

This action generates stunning representations of fit and confident women using advanced AI techniques. It is designed to inspire and redefine standards of beauty and athleticism.

Category: Image Generation

Input

The action requires a well-structured JSON payload to function. Here’s a breakdown of the input schema:

  • mask (string, optional): URI of the input mask for inpaint mode. Black areas are preserved, and white areas are inpainted.
  • seed (integer, optional): Random seed for image generation.
  • image (string, optional): URI of the input image used for img2img or inpaint mode.
  • width (integer, default: 1024): Width of the output image.
  • height (integer, default: 1024): Height of the output image.
  • prompt (string, default: "An astronaut riding a rainbow unicorn"): Describes the content to be generated.
  • refine (string, default: "no_refiner"): Selects the refinement style for image processing.
  • loraScale (number, default: 0.6): LoRA additive scale (0-1).
  • scheduler (string, default: "K_EULER"): Scheduler to be used for image generation.
  • guidanceScale (number, default: 7.5): Scale for classifier-free guidance (1-50).
  • applyWatermark (boolean, default: true): Option to apply a watermark to generated images.
  • negativePrompt (string, optional): Excludes specific undesirable elements from the image.
  • promptStrength (number, default: 0.8): Strength of the prompt when using img2img or inpaint.
  • numberOfOutputs (integer, default: 1): Total number of images to generate (1-4).
  • highNoiseFraction (number, default: 0.8): Fraction of noise for the expert ensemble refiner.
  • inferenceStepCount (integer, default: 50): Number of denoising steps (1-500).
  • disableSafetyChecker (boolean, default: false): Disables the safety checker for generated images.

Example Input:

{
  "width": 1024,
  "height": 1024,
  "prompt": "A pretty woman is drinking a red wine at home, in the style of AquaAI's fitnessme",
  "refine": "no_refiner",
  "loraScale": 0.6,
  "scheduler": "K_EULER",
  "guidanceScale": 7.5,
  "applyWatermark": true,
  "negativePrompt": "bad anatomy, bad hands, three hands, three legs, bad arms, missing legs, missing arms, poorly drawn face, bad face, fused face, cloned face, worst face, three crus, extra crus, fused crus, worst feet, three feet, fused feet, fused thigh, three thigh, fused thigh, extra thigh, worst thigh, missing fingers, extra fingers, ugly fingers, long fingers, horn, extra eyes, huge eyes, 2girl, amputation, disconnected limbs, cartoon, cg, 3d, unreal, animate, not human, no head",
  "promptStrength": 0.8,
  "numberOfOutputs": 1,
  "highNoiseFraction": 0.8,
  "inferenceStepCount": 50
}

Output

Upon successful execution, the action returns an array containing the URLs of the generated images.

Example Output:

[
  "https://assets.cognitiveactions.com/invocations/c77d584d-e80e-454f-abce-5e2ff6ef2154/9fe93547-1ad0-4713-85f0-edfcf2a5d6a7.png"
]

Conceptual Usage Example (Python)

Here’s how a developer might call this 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 = "7dbbdbb2-7e19-4518-b036-3047802d8a9b"  # Action ID for Generate AI-Powered Gym Goddess Image

# Construct the input payload based on the action's requirements
payload = {
    "width": 1024,
    "height": 1024,
    "prompt": "A pretty woman is drinking a red wine at home, in the style of AquaAI's fitnessme",
    "refine": "no_refiner",
    "loraScale": 0.6,
    "scheduler": "K_EULER",
    "guidanceScale": 7.5,
    "applyWatermark": True,
    "negativePrompt": "bad anatomy, bad hands, three hands, three legs, bad arms, missing legs, missing arms, poorly drawn face, bad face, fused face, cloned face, worst face, three crus, extra crus, fused crus, worst feet, three feet, fused feet, fused thigh, three thigh, fused thigh, extra thigh, worst thigh, missing fingers, extra fingers, ugly fingers, long fingers, horn, extra eyes, huge eyes, 2girl, amputation, disconnected limbs, cartoon, cg, 3d, unreal, animate, not human, no head",
    "promptStrength": 0.8,
    "numberOfOutputs": 1,
    "highNoiseFraction": 0.8,
    "inferenceStepCount": 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 AI-Powered Gym Goddess Image action.
  • The payload variable constructs the required input based on the action's schema.

Conclusion

The Generate AI-Powered Gym Goddess Image action from the FitnessMe Cognitive Actions provides a powerful way to create inspiring and aesthetically pleasing images. By integrating this action into your applications, you can enhance user experience, motivate creativity, and expand visual content capabilities. Start experimenting with the various input parameters and explore the possibilities of AI-driven image generation!