Create Stunning Images with the 90995055/992053_flux Cognitive Actions

21 Apr 2025
Create Stunning Images with the 90995055/992053_flux Cognitive Actions

In today's digital landscape, the ability to generate customized images on-the-fly is a powerful tool for developers. The 90995055/992053_flux offers a set of Cognitive Actions that allow developers to create highly personalized images through advanced image-to-image transformations and inpainting. With features like adjustable settings and rapid generation modes, these actions enable you to build innovative applications that leverage the creativity of AI.

Prerequisites

To use the Cognitive Actions from the 90995055/992053_flux, you'll need an API key for the Cognitive Actions platform. Authentication typically involves passing the API key in the headers of your requests. Ensure you have your API key ready to access the powerful capabilities of these actions.

Cognitive Actions Overview

Generate Customized Image

The Generate Customized Image action allows you to create tailored images based on your specific prompts and settings. This action supports various parameters, including masks for inpainting, aspect ratios, and image quality, enabling you to refine and enhance your generated outputs.

  • Category: image-generation

Input

The input for this action requires a JSON object that includes at least the prompt. Here’s a breakdown of the input schema:

  • prompt (required): A text prompt to guide the image generation.
  • model: Select between "dev" and "schnell" models for generation.
  • image: URI of the input image for transformation.
  • mask: URI of the image mask for inpainting.
  • width: Specifies the image width (custom).
  • height: Specifies the image height (custom).
  • imageFormat: Specifies the output image format (default is "webp").
  • outputCount: Number of images to generate (between 1 and 4).
  • imageQuality: Quality of output images (0 to 100).
  • loraStrength: Strength of the main LoRA in image generation.
  • additionalLora: Additional weights for fine-tuning.
  • imageAspectRatio: Determines the aspect ratio of the generated image.
  • promptIntensity: Influence of the text prompt in transformations.
  • guidanceIntensity: Adjusts the diffusion process guidance.
  • inferenceStepCount: Sets the number of denoising steps.
  • goFast: Toggle for faster, lower-quality outputs.
  • disableSafetyFeature: Enable or disable safety checks on generated images.

Example Input:

{
  "model": "dev",
  "prompt": "a picture of TRUMP47 sitting in a king chair. ultra realistic, Christmas setting",
  "imageFormat": "webp",
  "outputCount": 1,
  "imageQuality": 90,
  "loraStrength": 1,
  "promptIntensity": 0.8,
  "imageAspectRatio": "9:16",
  "guidanceIntensity": 2.5,
  "inferenceStepCount": 39,
  "additionalLoraStrength": 1
}

Output

The output of this action returns a list of generated image URLs based on the provided input parameters. Here's an example of what you could expect:

Example Output:

[
  "https://assets.cognitiveactions.com/invocations/cfb55e1f-b5bb-48f2-963a-53fa49addd36/e71f2941-965d-4e21-af2d-24aaa7a452fb.webp"
]

Conceptual Usage Example (Python)

Here’s how you might call the Generate Customized Image action in 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 = "f9ea683f-f85f-4889-ba77-ad448d33493c" # Action ID for Generate Customized Image

# Construct the input payload based on the action's requirements
payload = {
    "model": "dev",
    "prompt": "a picture of TRUMP47 sitting in a king chair. ultra realistic, Christmas setting",
    "imageFormat": "webp",
    "outputCount": 1,
    "imageQuality": 90,
    "loraStrength": 1,
    "promptIntensity": 0.8,
    "imageAspectRatio": "9:16",
    "guidanceIntensity": 2.5,
    "inferenceStepCount": 39,
    "additionalLoraStrength": 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, you can see how to structure the input JSON payload according to the action's requirements. Make sure to replace the API key and endpoint URL with your actual values.

Conclusion

The Cognitive Actions from 90995055/992053_flux empower developers to create customized images with minimal effort. By leveraging the capabilities of image-to-image transformation and inpainting, you can enhance your applications with unique visual content. Explore how these actions can be integrated into your projects and unleash your creativity!