Create Stunning Art with Celestial Pastel Illustrations Using oshtz/flux-celpast Actions

22 Apr 2025
Create Stunning Art with Celestial Pastel Illustrations Using oshtz/flux-celpast Actions

In the realm of digital creativity, the ability to generate unique and captivating images can significantly enhance applications, whether for games, marketing, or art projects. The oshtz/flux-celpast spec provides developers with a powerful Cognitive Action that allows for the creation of artistic images in a celestial pastel style. This action harnesses a LoRA model to produce visually stunning illustrations, enabling customization through various settings such as aspect ratios, image sizes, and quality. By integrating this action into your applications, you can offer users a unique and creative experience.

Prerequisites

Before diving into the integration of the oshtz/flux-celpast Cognitive Actions, ensure you have the following:

  • An API key for the Cognitive Actions platform to authenticate your requests.
  • Familiarity with sending HTTP requests in your programming language of choice.

Conceptually, authentication typically involves including your API key in the headers of your requests.

Cognitive Actions Overview

Generate Celestial Pastel Illustrations

This action is designed to produce artistic images using the celestial pastel style with a LoRA model. You can customize the output through various input parameters, allowing for a range of creative outputs.

Input

The input for this action requires the following fields, as outlined in the input_schema:

  • prompt (required): A text prompt guiding the image generation. For example, "celpast style illustration, monk in a zen garden at night".
  • model: Specifies the model for inference (default is "dev").
  • outputCount: The number of images to generate (default is 1, maximum is 4).
  • exportFormat: The format in which the image will be exported (default is "webp").
  • exportQuality: Quality of the output image ranging from 0 to 100 (default is 80).
  • Additional parameters include loraIntensity, imageAspectRatio, guidanceIntensity, and others aimed at fine-tuning the image generation.

Here’s an example input payload:

{
  "model": "dev",
  "prompt": "celpast style illustration, monk in a zen garden at night",
  "outputCount": 1,
  "exportFormat": "jpg",
  "exportQuality": 100,
  "loraIntensity": 1,
  "imageAspectRatio": "16:9",
  "guidanceIntensity": 4,
  "inferenceStepCount": 28
}

Output

The action returns an array of URLs pointing to the generated images. For example:

[
  "https://assets.cognitiveactions.com/invocations/40470b54-935a-44f7-808b-c5b3e9756402/ecc3a892-f453-467c-925a-641e0881a988.jpg"
]

If the request is successful, the output typically contains the URL(s) of the created image(s).

Conceptual Usage Example (Python)

Here’s how you might call this action using Python, demonstrating how to structure the input JSON payload:

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 = "0061c716-f2fd-4eca-babe-3c3605e46109"  # Action ID for Generate Celestial Pastel Illustrations

# Construct the input payload based on the action's requirements
payload = {
    "model": "dev",
    "prompt": "celpast style illustration, monk in a zen garden at night",
    "outputCount": 1,
    "exportFormat": "jpg",
    "exportQuality": 100,
    "loraIntensity": 1,
    "imageAspectRatio": "16:9",
    "guidanceIntensity": 4,
    "inferenceStepCount": 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 snippet, the action ID for generating celestial pastel illustrations is specified, along with a structured JSON input payload. The API key is used for authentication, and the script sends a POST request to the hypothetical execution endpoint.

Conclusion

The oshtz/flux-celpast Cognitive Action provides developers with a powerful tool to create visually appealing celestial pastel illustrations. By customizing the input parameters, you can generate unique images that enhance user engagement in your applications. Next steps could involve experimenting with different prompts and settings to explore the creative possibilities this action offers. Whether for art applications or creative marketing, harnessing these capabilities can elevate your projects to new heights.