Create Stunning Etching Style Images with the Acquaforte Cognitive Actions

In today's digital landscape, the ability to generate visually striking images has become a valuable asset for developers and artists alike. The Acquaforte Cognitive Actions offer a sophisticated solution for creating intricate etching-style images, allowing you to leverage advanced image inpainting techniques and customizable parameters. By utilizing these pre-built actions, you can seamlessly integrate image generation capabilities into your applications, whether for artistic creation, marketing, or content generation purposes.
Prerequisites
Before you can start using the Acquaforte Cognitive Actions, you will need to meet some basic requirements:
- API Key: You will need an API key for the Cognitive Actions platform to authenticate your requests.
- Setup: Familiarize yourself with the authentication process, which typically involves passing the API key in the headers of your requests.
Cognitive Actions Overview
Generate Custom Etching Style Image
The Generate Custom Etching Style Image action is designed to create images with a classical etching aesthetic, characterized by fine lines and high contrast. This action supports customizable dimensions and aspect ratios, ensuring that you can achieve the desired output quality and speed.
Input
The action requires a JSON payload with the following schema:
{
"prompt": "string", // mandatory
"mask": "string", // optional
"seed": "integer", // optional
"image": "string", // optional
"width": "integer", // optional
"height": "integer", // optional
"fastMode": "boolean", // optional
"outputCount": "integer", // optional
"mainLoraScale": "number", // optional
"additionalLora": "string", // optional
"inferenceModel": "string", // optional
"imageAspectRatio": "string", // optional
"imageOutputFormat": "string", // optional
"imageOutputQuality": "integer", // optional
"inferenceStepCount": "integer", // optional
"additionalLoraScale": "number", // optional
"inputPromptStrength": "number", // optional
"approximateMegapixels": "string", // optional
"safetyCheckerDisabled": "boolean", // optional
"diffusionGuidanceScale": "number" // optional
}
Here’s an example input payload:
{
"prompt": "A mythical phoenix with massive wings of fire perches on a jagged rock in the middle of a stormy sea. The waves crash violently against the dark, sharp cliffs, sending white foam and mist into the air. The scene is depicted in the style of an intricate aquaforte (etching engraving), with deep cross-hatching, fine lines, and high contrast between shadows and highlights. The phoenix’s feathers are detailed with bold strokes, giving the illusion of both texture and movement, as if its fiery wings could ignite the stormy sky. The composition is dramatic, with the sea in turmoil, dark clouds swirling above, and the bird standing as a majestic, almost divine figure against the chaos of nature. The whole scene has a timeless, classical etching aesthetic TOKFORTE",
"fastMode": false,
"outputCount": 4,
"mainLoraScale": 1,
"inferenceModel": "dev",
"imageAspectRatio": "1:1",
"imageOutputFormat": "jpg",
"imageOutputQuality": 100,
"inferenceStepCount": 28,
"additionalLoraScale": 1,
"inputPromptStrength": 0.8,
"approximateMegapixels": "1",
"diffusionGuidanceScale": 3
}
Output
When this action is executed, it typically returns an array of image URLs in the chosen format. Here’s an example of the output:
[
"https://assets.cognitiveactions.com/invocations/223bb49d-af85-4b44-a23e-9104c1af492e/9e02224b-2eb2-418b-839f-a53c33260975.jpg",
"https://assets.cognitiveactions.com/invocations/223bb49d-af85-4b44-a23e-9104c1af492e/2212a13d-182d-4f5b-bdff-a98b2f7e9b93.jpg",
"https://assets.cognitiveactions.com/invocations/223bb49d-af85-4b44-a23e-9104c1af492e/18f14343-728e-4dc0-a349-69042dfe9a92.jpg",
"https://assets.cognitiveactions.com/invocations/223bb49d-af85-4b44-a23e-9104c1af492e/dbbc5be8-b62d-4d68-8a04-b95dfde09f99.jpg"
]
Conceptual Usage Example (Python)
Here’s a conceptual example of how you might call this 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 = "243a5af5-0a71-436a-9051-782699b10c56" # Action ID for Generate Custom Etching Style Image
# Construct the input payload based on the action's requirements
payload = {
"prompt": "A mythical phoenix with massive wings of fire perches on a jagged rock in the middle of a stormy sea. The waves crash violently against the dark, sharp cliffs...",
"fastMode": False,
"outputCount": 4,
"mainLoraScale": 1,
"inferenceModel": "dev",
"imageAspectRatio": "1:1",
"imageOutputFormat": "jpg",
"imageOutputQuality": 100,
"inferenceStepCount": 28,
"additionalLoraScale": 1,
"inputPromptStrength": 0.8,
"approximateMegapixels": "1",
"diffusionGuidanceScale": 3
}
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 YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key. The action ID corresponds to the Generate Custom Etching Style Image action, and the payload is structured based on the required input schema. The endpoint URL and request structure are illustrative, focusing on how to format your request effectively.
Conclusion
The Acquaforte Cognitive Actions provide developers with powerful tools to create stunning images with a detailed etching style. By leveraging the capabilities of image inpainting and customizable parameters, you can produce high-quality visuals suitable for a range of applications. Explore the potential of these actions to enhance your projects, and consider experimenting with different prompts and settings to see how they can transform your creative ideas into reality.