Create Stunning 70s Band Aesthetic Images with Derrick's Cognitive Actions

24 Apr 2025
Create Stunning 70s Band Aesthetic Images with Derrick's Cognitive Actions

The derrrick/flux-70s-bands API offers developers the ability to generate unique and vibrant images that capture the essence of 70s band aesthetics. By utilizing advanced LoRA technology, these pre-built Cognitive Actions allow for extensive customization of image characteristics, providing an easy and efficient way to enhance applications with retro art styles. Let’s explore how you can leverage these actions to create engaging visuals that resonate with users.

Prerequisites

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

  • An API key for the Cognitive Actions platform. This key will be used for authentication when making API requests.
  • Basic understanding of JSON structure, as the input and output for these actions will be formatted in JSON.

Authentication typically involves passing the API key in the request headers.

Cognitive Actions Overview

Generate 70s Band Style Image

The Generate 70s Band Style Image action allows you to create images that embody the aesthetics of 70s bands. This action supports various customization options for creating images that fit your specific needs.

  • Category: Image Generation
  • Purpose: Generate images with customizable width, height, and LoRA intensity, optimized for both standard and faster processing modes.

Input

The input schema for this action requires you to provide a JSON object with the following fields:

  • Required:
    • prompt: A string that describes the image you want to generate (e.g., "band playing, 70s, in the style of S7NTY").
  • Optional:
    • mask: URI of an image mask for inpainting.
    • seed: Integer for reproducible results.
    • image: URI of an input image for transformations.
    • width: Integer defining the width of the image (256 to 1440).
    • height: Integer defining the height of the image (256 to 1440).
    • goFast: Boolean to enable faster predictions.
    • loraScale: Float for LoRA intensity (range: -1 to 3).
    • modelType: Specifies which model to use (options: "dev", "schnell").
    • numOutputs: Integer for the number of images to generate (1 to 4).
    • aspectRatio: String defining the aspect ratio (e.g., "5:4").
    • outputFormat: Image format for output (e.g., "jpg", "png").
    • and several others to fine-tune the image generation.

Example Input:

{
  "prompt": "band playing, 70s, in the style of S7NTY",
  "loraScale": 0.71,
  "modelType": "dev",
  "numOutputs": 1,
  "aspectRatio": "5:4",
  "outputFormat": "jpg",
  "guidanceScale": 3.5,
  "outputQuality": 80,
  "extraLoraScale": 0.8,
  "numInferenceSteps": 28
}

Output

The action typically returns a JSON array containing URLs of the generated images.

Example Output:

[
  "https://assets.cognitiveactions.com/invocations/1540cd11-6187-4d20-b002-1ee81a454749/62cae212-247c-4156-8d7f-f75608f99fe9.jpg"
]

Conceptual Usage Example (Python)

Here’s how you might call the Generate 70s Band Style Image 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 = "0780f83c-c174-4554-b52a-ed16ebf75e6a"  # Action ID for Generate 70s Band Style Image

# Construct the input payload based on the action's requirements
payload = {
    "prompt": "band playing, 70s, in the style of S7NTY",
    "loraScale": 0.71,
    "modelType": "dev",
    "numOutputs": 1,
    "aspectRatio": "5:4",
    "outputFormat": "jpg",
    "guidanceScale": 3.5,
    "outputQuality": 80,
    "extraLoraScale": 0.8,
    "numInferenceSteps": 28
}

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:

  • Replace YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key.
  • The payload variable is constructed based on the action's required input schema.
  • The requests.post() method is used to initiate the call to the hypothetical Cognitive Actions endpoint.

Conclusion

The Cognitive Actions provided by the derrrick/flux-70s-bands API enable developers to seamlessly generate nostalgic 70s band-style images, enhancing applications with visually appealing content. With a wide range of customizable parameters, you can tailor the image generation process to meet your specific needs. Next steps could include exploring additional actions, integrating them further into your applications, or experimenting with different parameters to see how they affect the output. Happy coding!