Generate Stunning Images with the Flux Tesla Cybercab Cognitive Actions

22 Apr 2025
Generate Stunning Images with the Flux Tesla Cybercab Cognitive Actions

Integrating cutting-edge AI capabilities into your applications has never been easier with the fofr/flux-tesla-cybercab Cognitive Actions. This set of image generation actions allows developers to create highly customized images using the Flux LoRA model. With features that include various aspect ratios, quality settings, and the ability to utilize both detailed and fast generation models, you can generate unique images tailored to your specifications.

Prerequisites

Before diving into the Cognitive Actions, ensure you have the following:

  • An API key for the Cognitive Actions platform to authenticate your requests.
  • Basic knowledge of making API calls and handling JSON data.
  • Familiarity with Python for executing example code.

Authentication typically involves passing your API key in the headers of your requests.

Cognitive Actions Overview

Generate Flux Tesla Cybercab Image

Purpose: This action creates images using the Flux LoRA model, specifically designed for generating images with the CYBERCAB trigger. It offers customizable parameters such as aspect ratio, quality, and speed, allowing developers to fine-tune the output.

Category: Image Generation

Input: The input for this action requires a JSON object with the following fields:

  • prompt (required): A string that guides the image generation process.
  • loraScale (optional): Controls the intensity of the primary LoRA's application (default: 1).
  • inferenceModel (optional): Selects the inference model ('dev' for detailed generation, 'schnell' for faster results; default: 'dev').
  • inferenceSteps (optional): Defines the number of denoising steps (default: 28).
  • promptStrength (optional): Adjusts the strength of the prompt when using img2img (default: 0.8).
  • numberOfOutputs (optional): Specifies how many images to generate (default: 1).
  • imageAspectRatio (optional): Sets the aspect ratio of the output image (default: '1:1').
  • imageOutputFormat (optional): Determines the output file format (default: 'webp').
  • imageOutputQuality (optional): Sets the quality of the output images (default: 80).
  • additionalLoraScale (optional): Intensity of additional LoRA application (default: 1).
  • safetyCheckerDisabled (optional): Disables the safety checker (default: false).
  • diffusionGuidanceScale (optional): Sets the guidance scale for the diffusion process (default: 3).

Example Input:

{
  "prompt": "A photo of a CYBERCAB",
  "loraScale": 1,
  "inferenceModel": "dev",
  "inferenceSteps": 28,
  "promptStrength": 0.8,
  "numberOfOutputs": 1,
  "imageAspectRatio": "3:2",
  "imageOutputFormat": "webp",
  "imageOutputQuality": 90,
  "additionalLoraScale": 1,
  "safetyCheckerDisabled": false,
  "diffusionGuidanceScale": 3.5
}

Output: The action typically returns a list of URLs pointing to the generated images.

Example Output:

[
  "https://assets.cognitiveactions.com/invocations/6d545e0b-3462-43c6-b500-6733f6d12229/fd22d0c5-0e8b-48e5-ae7a-78d8e0a4610e.webp"
]

Conceptual Usage Example (Python): Here’s 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 = "9bc4bde3-a0c6-412d-93d1-eb8a22f82107" # Action ID for Generate Flux Tesla Cybercab Image

# Construct the input payload based on the action's requirements
payload = {
    "prompt": "A photo of a CYBERCAB",
    "loraScale": 1,
    "inferenceModel": "dev",
    "inferenceSteps": 28,
    "promptStrength": 0.8,
    "numberOfOutputs": 1,
    "imageAspectRatio": "3:2",
    "imageOutputFormat": "webp",
    "imageOutputQuality": 90,
    "additionalLoraScale": 1,
    "safetyCheckerDisabled": false,
    "diffusionGuidanceScale": 3.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 code snippet, you replace the placeholder with your actual API key and endpoint. The action ID and input payload are structured according to the action's requirements. This example demonstrates how to execute the action and handle the response.

Conclusion

The fofr/flux-tesla-cybercab Cognitive Actions provide an immense opportunity to incorporate sophisticated image generation capabilities into your applications. By utilizing the powerful features of the Flux LoRA model, you can create stunning images tailored to your specifications. Explore these actions further to unlock new possibilities in your development projects!