Create Stunning Liminal Space Images with Minimal Liminal Cognitive Actions

In the realm of image generation, the marcodemutiis/minimal_liminal API provides a powerful toolset through its Cognitive Actions. Specifically designed for generating unique and surreal images of liminal spaces, this API leverages a trained model that allows developers to create visually engaging content with a range of customization options. By utilizing these pre-built actions, developers can enhance their applications with captivating imagery without needing to delve into complex machine learning algorithms.
Prerequisites
Before getting started with the Minimal Liminal Cognitive Actions, ensure you have the following:
- An API key for the Cognitive Actions platform.
- Basic understanding of JSON and API requests.
- A Python environment set up to execute requests.
For authentication, you will typically pass your API key in the request headers to authenticate your calls to the Cognitive Actions endpoint.
Cognitive Actions Overview
Generate Liminal Space Images
The Generate Liminal Space Images action allows developers to create images of liminal spaces by specifying various parameters. This action is categorized under image-generation.
Input:
The input schema for this action is structured as follows:
mask: (string, URI) Required if inpaint mode is used, specifies the input mask for inpainting.seed: (integer) Optional seed for consistency; leave blank for random selection.image: (string, URI) Required for img2img or inpaint mode; URI of the input image.width: (integer) Width of the output image in pixels (default: 1024).height: (integer) Height of the output image in pixels (default: 1024).prompt: (string) Text prompt guiding image generation (default: "An astronaut riding a rainbow unicorn").refineStyle: (string) Refinement style to improve image quality (default: "no_refiner").alternateWeights: (string) Alternative weights for model training.outputImageCount: (integer) Number of images to generate (default: 1, max: 4).schedulingMethod: (string) Denoising scheduling method (default: "K_EULER").watermarkEnabled: (boolean) Enable watermark on generated images (default: true).highNoiseFraction: (number) Fraction of noise for refinement; applies to expert ensemble refiner (default: 0.8).loraAdditiveScale: (number) Scale for LoRA additive models (default: 0.6).inferenceStepCount: (integer) Number of denoising inference steps (default: 50).inputPromptStrength: (number) Strength of input prompt (default: 0.8).negativeInputPrompt: (string) Items to exclude from the generated image.refinementStepCount: (integer) Number of refinement steps for base image refinement.safetyCheckerDisabled: (boolean) Enable or disable safety checker (default: false).classifierFreeGuidanceScale: (number) Scale for classifier-free guidance (default: 7.5).
Example Input:
{
"width": 1024,
"height": 1024,
"prompt": "A photograph of an underground minimal_liminal metro station in New York picturing many animals falling and a floating humpback whale",
"refineStyle": "no_refiner",
"outputImageCount": 1,
"schedulingMethod": "K_EULER",
"watermarkEnabled": true,
"highNoiseFraction": 0.8,
"loraAdditiveScale": 0.72,
"inferenceStepCount": 50,
"inputPromptStrength": 0.8,
"negativeInputPrompt": "elephant, office, overhead lighting, water, underwater",
"classifierFreeGuidanceScale": 7.5
}
Output:
The action typically returns an array of image URLs generated based on the provided parameters. Here’s an example of the output:
[
"https://assets.cognitiveactions.com/invocations/e4c1aa1d-3bed-473c-97c0-d39ba0a40064/d74e9aa9-6ccc-4521-be86-f3b5ae9371e0.png"
]
Conceptual Usage Example (Python):
Here is a conceptual Python code snippet demonstrating how to use the Generate Liminal Space Images action:
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 = "fd9712de-983f-4dac-9681-13b913851bd1" # Action ID for Generate Liminal Space Images
# Construct the input payload based on the action's requirements
payload = {
"width": 1024,
"height": 1024,
"prompt": "A photograph of an underground minimal_liminal metro station in New York picturing many animals falling and a floating humpback whale",
"refineStyle": "no_refiner",
"outputImageCount": 1,
"schedulingMethod": "K_EULER",
"watermarkEnabled": True,
"highNoiseFraction": 0.8,
"loraAdditiveScale": 0.72,
"inferenceStepCount": 50,
"inputPromptStrength": 0.8,
"negativeInputPrompt": "elephant, office, overhead lighting, water, underwater",
"classifierFreeGuidanceScale": 7.5
}
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, replace YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key. The action_id variable corresponds to the specific action you are invoking. The input payload is structured according to the specified schema, ensuring all required fields are included.
Conclusion
The marcodemutiis/minimal_liminal Cognitive Actions offer a straightforward yet powerful way to generate captivating images of liminal spaces. By leveraging the various options available, developers can create unique and expressive artwork tailored to their needs. Consider exploring further use cases, such as integrating these images into creative applications or enhancing user experiences in virtual environments. Start experimenting with these actions today and unlock the potential of surreal imagery in your projects!