Generating Stunning Yeşilçam Style Images with okturan/flux-yesilcam Cognitive Actions

In the world of digital content creation, the ability to generate visually captivating images can significantly enhance user engagement and storytelling. The okturan/flux-yesilcam API provides a powerful Cognitive Action that enables developers to create images that emulate the unique aesthetic and scenes typical of Yeşilçam movies. This pre-built action allows for rapid image generation, making it a valuable tool for developers looking to integrate creative visuals into their applications.
Prerequisites
Before diving into the integration of the Yeşilçam image generation action, ensure you have the following:
- An API key for the Cognitive Actions platform.
- Basic knowledge of how to make HTTP requests in your preferred programming language.
- A setup environment that can send JSON payloads.
For authentication, you will typically pass your API key in the headers of your requests.
Cognitive Actions Overview
Generate Yeşilçam Style Images
Description: This action creates images that mimic the aesthetic and scenes from Yeşilçam films, utilizing models optimized either for speed or detail.
Category: Image Generation
Input: The input schema requires the following fields:
- prompt (required): A string that describes the scene or concept for the image.
- width (optional): Specifies the width of the generated image (must be a multiple of 16).
- height (optional): Specifies the height of the generated image (must be a multiple of 16).
- aspectRatio (optional): Sets the aspect ratio for the image.
- numOutputs (optional): Defines the number of images to generate (1 to 4).
- outputFormat (optional): Format of the generated images (e.g., webp, jpg, png).
- guidanceScale (optional): Determines the degree of adherence to the prompt.
- seed (optional): Sets a random seed for reproducibility.
- goFast (optional): A boolean to enable faster predictions.
Example Input:
{
"width": 512,
"height": 512,
"prompt": "A scene from a YSLCM movie, A family in a station wagon parks two spots over from a grocer.",
"loraScale": 1.2,
"modelName": "dev",
"numOutputs": 4,
"aspectRatio": "1:1",
"outputFormat": "webp",
"guidanceScale": 3,
"outputQuality": 80,
"extraLoraScale": 0.8,
"numInferenceSteps": 35
}
Output: The action typically returns an array of URLs pointing to the generated images in the specified format. For example:
[
"https://assets.cognitiveactions.com/invocations/463744a1-cd6b-4c4d-9a06-68efc7ce4f84/a17fe1af-e75d-4d78-99c8-f8c181b3055a.webp",
"https://assets.cognitiveactions.com/invocations/463744a1-cd6b-4c4d-9a06-68efc7ce4f84/7c78d185-6dd1-490b-bafe-94fee211e825.webp"
]
Conceptual Usage Example (Python): Here’s how you might call the Yeşilçam image generation 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 = "81157613-d1c0-4b53-910c-a0db9e6a7284" # Action ID for Generate Yeşilçam Style Images
# Construct the input payload based on the action's requirements
payload = {
"width": 512,
"height": 512,
"prompt": "A scene from a YSLCM movie, A family in a station wagon parks two spots over from a grocer.",
"loraScale": 1.2,
"modelName": "dev",
"numOutputs": 4,
"aspectRatio": "1:1",
"outputFormat": "webp",
"guidanceScale": 3,
"outputQuality": 80,
"extraLoraScale": 0.8,
"numInferenceSteps": 35
}
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 code snippet, you replace the API key and endpoint with your specific details. The input payload is structured according to the action's requirements, and the script sends a POST request to execute the action.
Conclusion
The okturan/flux-yesilcam Cognitive Action empowers developers to create stunning Yeşilçam style images with ease. By leveraging the provided input options, you can customize the generated content to fit your application's needs. Whether for enhancing storytelling in applications or creating unique marketing content, this action opens up a world of creative possibilities. Start integrating it into your projects today and explore the captivating visuals that await!