Unleashing Creativity: Generate Stunning Images with Flux Uncensored Actions

23 Apr 2025
Unleashing Creativity: Generate Stunning Images with Flux Uncensored Actions

In the world of AI-driven creativity, the ability to generate images from text descriptions opens up a plethora of opportunities for developers and artists alike. The aisha-ai-official/flux.1dev-uncensored-colossus-v5 offers a powerful set of Cognitive Actions that make it easy to create visually striking images using the Flux Uncensored model. This blog post will explore how to leverage these actions to enhance your applications with image generation capabilities.

Prerequisites

Before you dive into using the Flux Uncensored actions, ensure you have the following:

  • An API key for the Cognitive Actions platform to authenticate your requests.
  • Basic knowledge of how to make API calls, especially using JSON format for input and output.
  • Familiarity with Python, as we will provide example code snippets to illustrate how to integrate the action into your applications.

Authentication typically involves passing your API key in the request headers for each call you make to the Cognitive Actions endpoint.

Cognitive Actions Overview

Generate Image with Flux Uncensored

The Generate Image with Flux Uncensored action allows you to create images based on descriptive text inputs. You can customize various attributes such as width, height, and the number of steps taken during the generation process. Additionally, options for seed selection and different scheduling methods for image denoising are available to enhance the quality of the generated images.

Input

The input for this action requires the following fields:

  • prompt (required): A descriptive string that serves as the basis for image generation.
  • seed (optional): An integer to specify the seed for generation; use -1 for a random seed. Default is -1.
  • steps (optional): An integer that determines the number of steps for generation. Acceptable values range from 4 to 50, with a default of 20.
  • width (optional): An integer defining the width of the output image, ranging from 512 to 2048, with a default of 1024.
  • height (optional): An integer defining the height of the output image, ranging from 512 to 2048, with a default of 1024.
  • cfgScale (optional): A number that controls how much attention the model gives to the prompt during generation. The range is 0 to 20, with a default of 5.
  • scheduler (optional): A string that specifies the denoising scheduler used for the generated image. Options include "default," "Euler flux Karras," "Euler flux simple," "Euler flux exponential," and "Euler flux beta." The default is "default."

Example Input:

{
  "seed": -1,
  "steps": 30,
  "width": 768,
  "height": 768,
  "prompt": "Portrait of a beauty woman with full dark-purple short hair and purple eyes. She is on a street, wearing casual clothes. She is holding a big sign that says \"Flux Uncensored πŸ’œ\" when she winks and smile to the viewer",
  "cfgScale": 5,
  "scheduler": "Euler flux beta"
}

Output

The action returns a URL pointing to the generated image.

Example Output:

[
  "https://assets.cognitiveactions.com/invocations/af9e0923-4945-41cf-aa73-07affb7285d4/0926cdff-fa5b-498a-8262-95ca6b6dd574.png"
]

Conceptual Usage Example (Python)

Here’s how you might call this action using Python. The following code snippet constructs the input payload and makes a request to the 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 = "e50c1fed-0578-4c9d-a4a8-4d2ae8549280" # Action ID for Generate Image with Flux Uncensored

# Construct the input payload based on the action's requirements
payload = {
    "seed": -1,
    "steps": 30,
    "width": 768,
    "height": 768,
    "prompt": "Portrait of a beauty woman with full dark-purple short hair and purple eyes. She is on a street, wearing casual clothes. She is holding a big sign that says \"Flux Uncensored πŸ’œ\" when she winks and smile to the viewer",
    "cfgScale": 5,
    "scheduler": "Euler flux beta"
}

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, replace YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key. The action ID is included to specify which Cognitive Action you are invoking, and the payload is structured according to the input schema requirements.

Conclusion

The aisha-ai-official/flux.1dev-uncensored-colossus-v5 Cognitive Actions provide a powerful and flexible way to generate images from descriptive text. By leveraging the options available, developers can create bespoke visual content tailored to a variety of use cases. Start integrating these actions into your applications today and unlock new creative possibilities!