Create Stunning 70s Congo-Inspired Images with svngoku/sdxl-africans Cognitive Actions

In the world of image generation, the svngoku/sdxl-africans Cognitive Actions offer an exciting way to create visually striking images inspired by the unique aesthetics of the 1970s Congo. Leveraging a model trained on the rich collection of Maurice 'Pellosh' Bidilou, these actions allow developers to generate images through customizable settings, including img2img and inpainting modes. This blog post will guide you through the capabilities of these actions and how to seamlessly integrate them into your applications.
Prerequisites
Before you get started, ensure you have the following:
- An API key for accessing the Cognitive Actions platform.
- Familiarity with making HTTP requests, particularly using JSON.
- A basic understanding of how to handle image data in your application.
Authentication can typically be handled by passing your API key in the headers of your requests.
Cognitive Actions Overview
Generate 70s Congo Photography
Description: This action creates images inspired by the photographic styles of the Congo in the 1970s. With options for img2img and inpainting modes, developers can customize various parameters such as guidance scale and prompt strength to generate unique artwork.
Category: Image Generation
Input
The input schema for this action requires several fields:
- prompt (string): A description of the desired output image.
- width (integer): The width of the output image in pixels (default: 1024).
- height (integer): The height of the output image in pixels (default: 1024).
- refineStyle (string): The style for image refinement (default: no_refiner).
- scheduleType (string): Type of scheduler for denoising (default: K_EULER).
- applyWatermark (boolean): Whether to add a watermark (default: true).
- numberOfOutputs (integer): The number of images to generate (default: 1, max: 4).
- highNoiseFraction (number): Fraction of noise for expert ensemble refiner (default: 0.8).
- loraAdditiveScale (number): Scale for LoRA additive changes (default: 0.6).
- inputNegativePrompt (string): Optional prompt to avoid unintended content.
- inputPromptStrength (number): Strength of the prompt when using img2img/inpaint (default: 0.8).
- numberOfInferenceSteps (integer): Steps for denoising (default: 50, max: 500).
- classifierFreeGuidanceScale (number): Scaling factor for classifier-free guidance (default: 7.5).
Example Input:
{
"width": 1024,
"height": 1024,
"prompt": "A photo of two africans womans dressed with Wax stand together with arms crossed in the middle, africa from 70s",
"refineStyle": "no_refiner",
"scheduleType": "K_EULER",
"applyWatermark": true,
"numberOfOutputs": 4,
"highNoiseFraction": 0.8,
"loraAdditiveScale": 0.6,
"inputNegativePrompt": "",
"inputPromptStrength": 0.91,
"numberOfInferenceSteps": 50,
"classifierFreeGuidanceScale": 7.5
}
Output
The action returns an array of URLs pointing to the generated images. The output typically looks like this:
Example Output:
[
"https://assets.cognitiveactions.com/invocations/cce257de-ab3a-4f25-ac44-0d8f7d36ea73/28ff1c76-309b-40af-8b6c-5a2843ecf9e2.png",
"https://assets.cognitiveactions.com/invocations/cce257de-ab3a-4f25-ac44-0d8f7d36ea73/d4e89f4d-f274-4b60-b16f-b3304c5dccbc.png",
"https://assets.cognitiveactions.com/invocations/cce257de-ab3a-4f25-ac44-0d8f7d36ea73/af69df22-834e-4055-97b2-9bf65e3250c8.png",
"https://assets.cognitiveactions.com/invocations/cce257de-ab3a-4f25-ac44-0d8f7d36ea73/192f0a8c-bbd5-4ab1-bc1e-58c2e44f9b16.png"
]
Conceptual Usage Example (Python)
Here’s a conceptual Python snippet demonstrating how to call this Cognitive 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 = "63ec8034-bf6b-4ef4-9bb9-51258c4792c3" # Action ID for Generate 70s Congo Photography
# Construct the input payload based on the action's requirements
payload = {
"width": 1024,
"height": 1024,
"prompt": "A photo of two africans womans dressed with Wax stand together with arms crossed in the middle, africa from 70s",
"refineStyle": "no_refiner",
"scheduleType": "K_EULER",
"applyWatermark": True,
"numberOfOutputs": 4,
"highNoiseFraction": 0.8,
"loraAdditiveScale": 0.6,
"inputNegativePrompt": "",
"inputPromptStrength": 0.91,
"numberOfInferenceSteps": 50,
"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 example, replace the placeholder API key and endpoint with your actual credentials. The action ID and input payload are structured according to the requirements of the Generate 70s Congo Photography action.
Conclusion
The svngoku/sdxl-africans Cognitive Actions provide a powerful and flexible way to generate unique images inspired by the rich cultural heritage of the 1970s Congo. By utilizing the customizable parameters of the Generate 70s Congo Photography action, developers can create eye-catching visuals for a variety of applications. Explore these capabilities and integrate them into your projects to enhance user engagement and creativity!