Generate Stunning Female Images with pilou57/piloupixar Cognitive Actions

In the realm of image generation, the pilou57/piloupixar API offers innovative Cognitive Actions that empower developers to create visually striking and coherent images. With advanced capabilities like img2img and inpainting modes, along with customizable prompts and refinement options, these actions are perfect for applications that require high-quality image synthesis. By integrating these pre-built actions into your application, you can leverage powerful image generation techniques with minimal effort.
Prerequisites
Before diving into the Cognitive Actions, ensure you have the necessary setup:
- An API key for the pilou57/piloupixar platform.
- Basic knowledge of making API calls, particularly how to structure headers and payloads for RESTful services.
To authenticate your requests, you will typically pass your API key in the headers. This allows the Cognitive Actions to verify your identity and grant access to the required functionalities.
Cognitive Actions Overview
Generate Coherent Female Images
Description: This action creates coherent images of women using advanced image generation techniques. It supports features like img2img or inpainting modes and offers options for prompt customization, refinement styles, and scheduling methods.
Category: Image Generation
Input
The input schema for this action is structured as follows:
- mask (string, optional): Input mask for inpainting mode. Areas in black are preserved, while areas in white are subject to inpainting.
- seed (integer, optional): Specifies a random seed. Leave blank for random generation.
- image (string, optional): URI of the input image for img2img or inpainting mode.
- width (integer, default: 1024): Width of the output image in pixels.
- height (integer, default: 1024): Height of the output image in pixels.
- prompt (string, default: "An astronaut riding a rainbow unicorn"): Text prompt describing the desired image.
- refine (string, default: "no_refiner"): Selects the refinement style (options: "no_refiner", "expert_ensemble_refiner", "base_image_refiner").
- loraScale (number, default: 0.6): LoRA additive scaling factor for trained models (0 to 1).
- scheduler (string, default: "K_EULER"): Determines the scheduling method for processing.
- numOutputs (integer, default: 1, range: 1-4): Number of image outputs desired.
- loraWeights (string, optional): Specifies the LoRA weights to be utilized.
- refineSteps (integer, optional): Sets the number of refinement steps for "base_image_refiner".
- guidanceScale (number, default: 7.5, range: 1-50): Classifier-free guidance scale for image influence.
- highNoiseFrac (number, default: 0.8, range: 0-1): Fraction of noise for "expert_ensemble_refiner".
- applyWatermark (boolean, default: true): Enables or disables watermark application.
- negativePrompt (string, default: ""): Text prompt specifying features to avoid.
- promptStrength (number, default: 0.8, range: 0-1): Impact of the prompt in img2img or inpainting modes.
- numInferenceSteps (integer, default: 50, range: 1-500): Total number of denoising process steps.
- disableSafetyChecker (boolean, default: false): Controls the safety checker for generated images.
Example Input:
{
"width": 1024,
"height": 1024,
"prompt": "TOK, a girl with brown hairs and green eyes, proportional human body and face, jumping off a cliff, diving, in a bikini, people at the top of the cliff are watching, highly detailed, hyper textured, 3D render, vivid and vibrant colors, modern pixar animation style",
"refine": "expert_ensemble_refiner",
"loraScale": 0.6,
"scheduler": "K_EULER",
"numOutputs": 1,
"guidanceScale": 9,
"highNoiseFrac": 0.8,
"applyWatermark": false,
"negativePrompt": "sketch, flat, 2D, hand drawn",
"promptStrength": 1,
"numInferenceSteps": 40
}
Output
The action typically returns a URL pointing to the generated image.
Example Output:
[
"https://assets.cognitiveactions.com/invocations/840bf6f7-03af-49da-97df-597db3b1b0f8/2ef3c915-c7d6-47d5-82d9-1363b08876d7.png"
]
Conceptual Usage Example (Python)
Here's how you might call the Generate Coherent Female Images 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 = "65417c45-437a-4227-af7c-f8bed5587013" # Action ID for Generate Coherent Female Images
# Construct the input payload based on the action's requirements
payload = {
"width": 1024,
"height": 1024,
"prompt": "TOK, a girl with brown hairs and green eyes, proportional human body and face, jumping off a cliff, diving, in a bikini, people at the top of the cliff are watching, highly detailed, hyper textured, 3D render, vivid and vibrant colors, modern pixar animation style",
"refine": "expert_ensemble_refiner",
"loraScale": 0.6,
"scheduler": "K_EULER",
"numOutputs": 1,
"guidanceScale": 9,
"highNoiseFrac": 0.8,
"applyWatermark": False,
"negativePrompt": "sketch, flat, 2D, hand drawn",
"promptStrength": 1,
"numInferenceSteps": 40
}
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}
)
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 payload dictionary is constructed based on the required or optional fields specified in the input schema for the action. The script makes a POST request to the hypothetical endpoint to execute the action and print the result.
Conclusion
The pilou57/piloupixar Cognitive Actions provide a powerful way to generate stunning images of women with customizable options to suit your application needs. Whether you are looking to create artworks, illustrations, or other graphics, these actions simplify the process of image generation. Start integrating these actions into your applications today and explore the endless possibilities of creative image synthesis!