Create Stunning 3D Reference Sheets with the aliadhami/3d-sheet Cognitive Actions

In the world of design and visualization, the ability to generate detailed technical designs quickly can significantly enhance productivity. The aliadhami/3d-sheet Cognitive Actions offer developers a powerful toolset for generating high-quality, consistent 3-view designs of objects. These actions facilitate the creation of front, back, and side views, ensuring clear visualization of dimensions in a style similar to technical 3D reference sheets.
Prerequisites
Before you can start using the Cognitive Actions, you will need:
- An API key for the Cognitive Actions platform to authenticate your requests.
- Basic knowledge of JSON format, as the inputs and outputs are structured in JSON.
Authentication typically involves passing your API key in the headers of your requests, ensuring that your calls to the service are secure and authorized.
Cognitive Actions Overview
Generate 3-View Technical Design
The Generate 3-View Technical Design action is engineered to produce minimal and consistent designs of objects from three distinct views, enhancing clarity in object representation.
Input
To invoke this action, you need to provide a JSON payload that includes the following required and optional fields:
- prompt (required): A detailed description of the object to be designed.
- width: The width of the generated image (default is 1440, between 256 and 1440).
- height: The height of the generated image (default is 593, between 256 and 1440).
- modelType: Specifies the model to run (default is "dev").
- loraImpact: Scale for applying the main LoRA (default is 1).
- imageFormat: Format of the output image (default is "webp").
- outputCount: The number of images to generate (default is 1, maximum is 4).
- imageQuality: Quality of the output image (default is 80).
- denoisingSteps: Number of steps for image generation (default is 28).
- enableFastMode: Boolean to enable faster predictions (default is false).
- imageAspectRatio: Aspect ratio for the generated image (default is "1:1").
- diffusionGuidance: Scale for the diffusion process (default is 3).
Here's an example of how to structure the input JSON:
{
"width": 1440,
"height": 593,
"prompt": "In the style of 3dsheet, three consistent views of the same realistic Jesus head-and-neck figure with crown of thorns, lifelike skin, brown hair, greenish eyes, texture, visible neck, and upper shoulders. Front view shows a solemn face with natural facial features, detailed beard, crown resting on the brow, and fabric line of a robe at the shoulders. Back view displays textured hair flowing down the neck, crown wrapping fully around the head with thorn detail, and subtle shoulder form. Side view presents the realistic facial profile, visible skin folds on the neck, sharp crown thorns, and robe edge at the upper shoulder. All three views maintain consistent proportions of this single realistic Jesus head-and-neck figure against a white background.",
"modelType": "dev",
"loraImpact": 0.7,
"imageFormat": "webp",
"outputCount": 4,
"imageQuality": 80,
"denoisingSteps": 28,
"enableFastMode": false,
"imageAspectRatio": "custom",
"diffusionGuidance": 3
}
Output
Upon successful execution, the action will return an array of URLs pointing to the generated images. Here's an example of what the output might look like:
[
"https://assets.cognitiveactions.com/invocations/63e49c4a-7d53-4f47-b30e-3918c6170688/19e6b751-8ca9-4860-a31e-9733330ed646.webp",
"https://assets.cognitiveactions.com/invocations/63e49c4a-7d53-4f47-b30e-3918c6170688/81196aa0-96e1-49ea-ba1b-2e47e537fbfc.webp",
"https://assets.cognitiveactions.com/invocations/63e49c4a-7d53-4f47-b30e-3918c6170688/31d641da-c65e-4875-a6f4-bad7a9c36f00.webp",
"https://assets.cognitiveactions.com/invocations/63e49c4a-7d53-4f47-b30e-3918c6170688/72be5916-becc-4c1d-ac6b-31af1b023ac8.webp"
]
Conceptual Usage Example (Python)
Here's a conceptual example of how to call the Generate 3-View Technical Design 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 = "6c83f1e4-b1d0-4b60-8dbe-0f423ba9f1f4" # Action ID for Generate 3-View Technical Design
# Construct the input payload based on the action's requirements
payload = {
"width": 1440,
"height": 593,
"prompt": "In the style of 3dsheet, three consistent views of the same realistic Jesus head-and-neck figure with crown of thorns, lifelike skin, brown hair, greenish eyes, texture, visible neck, and upper shoulders. Front view shows a solemn face with natural facial features, detailed beard, crown resting on the brow, and fabric line of a robe at the shoulders. Back view displays textured hair flowing down the neck, crown wrapping fully around the head with thorn detail, and subtle shoulder form. Side view presents the realistic facial profile, visible skin folds on the neck, sharp crown thorns, and robe edge at the upper shoulder. All three views maintain consistent proportions of this single realistic Jesus head-and-neck figure against a white background.",
"modelType": "dev",
"loraImpact": 0.7,
"imageFormat": "webp",
"outputCount": 4,
"imageQuality": 80,
"denoisingSteps": 28,
"enableFastMode": false,
"imageAspectRatio": "custom",
"diffusionGuidance": 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 the YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key. The action ID is set for the Generate 3-View Technical Design, and the payload is structured based on the required fields.
Conclusion
The aliadhami/3d-sheet Cognitive Actions provide a powerful way to generate stunning 3D reference sheets with just a few lines of code. By leveraging the ability to create consistent and detailed technical designs, developers can greatly enhance their applications in areas such as product design, animation, and educational tools. Start integrating these actions today and explore the creative possibilities they unlock!