Create Stunning Images with the floppive/10therockwyne Cognitive Actions

22 Apr 2025
Create Stunning Images with the floppive/10therockwyne Cognitive Actions

In today's digital landscape, the ability to generate custom images tailored to specific prompts is a game-changer for developers. The floppyve/10therockwyne Cognitive Actions provide a powerful API for generating images using advanced techniques like LoRA (Low-Rank Adaptation). This enables developers to create unique visuals that can be used in applications ranging from marketing to content creation. In this article, we’ll dive into the features and functionality of the Generate Custom Images with LoRA action, guiding you through the integration process.

Prerequisites

Before you begin, ensure you have the following:

  • An API key for the Cognitive Actions platform to authenticate your requests.
  • Familiarity with JSON structure, as you will be sending and receiving JSON data.

Authentication typically involves passing your API key in the headers of your requests, allowing you to securely access the Cognitive Actions.

Cognitive Actions Overview

Generate Custom Images with LoRA

The Generate Custom Images with LoRA action allows you to create customized images by specifying prompts and various parameters such as scale, aspect ratio, and resolution. It also supports image inpainting and optimizes the generation quality and speed.

Input

The input schema for this action requires a prompt and offers several optional fields to customize the output:

{
  "prompt": "10therockwyne, channeling the charm and larger-than-life persona of The Rock...",
  "modelType": "dev",
  "loraIntensity": 1,
  "enableFastMode": false,
  "inferenceSteps": 28,
  "imageResolution": "1",
  "numberOfOutputs": 2,
  "imageAspectRatio": "9:16",
  "imageOutputFormat": "webp",
  "extraLoraIntensity": 1,
  "imageOutputQuality": 80,
  "inputPromptStrength": 0.8,
  "diffusionGuidanceScale": 3
}

Example Input Explanation

  • prompt: A detailed description of the image you want to generate.
  • modelType: Specifies which model to use; options include dev or schnell.
  • loraIntensity: Adjusts the strength of the LoRA application.
  • enableFastMode: Enables a faster prediction model.
  • inferenceSteps: Number of denoising steps for image generation.
  • imageResolution: Approximate megapixel count.
  • numberOfOutputs: Specifies how many images to generate (max 4).
  • imageAspectRatio: The desired aspect ratio of the output image.
  • imageOutputFormat: Format for the generated images (e.g., webp, jpg, png).
  • extraLoraIntensity: Adjusts the strength of an additional LoRA application.
  • imageOutputQuality: Sets the quality of the output image.
  • inputPromptStrength: Controls how closely the generated image adheres to the prompt.
  • diffusionGuidanceScale: Sets guidance scale for generating images.

Output

The output of this action typically includes URLs to the generated images. For example:

[
  "https://assets.cognitiveactions.com/invocations/ef93b071-5b95-4105-820d-6e97e0f7a25d/ab6517a8-1f4d-432e-a88f-4956136ff109.webp",
  "https://assets.cognitiveactions.com/invocations/ef93b071-5b95-4105-820d-6e97e0f7a25d/3a86d986-c0bf-4932-ab95-c5285ec9bc3b.webp"
]

Example Output Explanation

  • Each URL points to a generated image based on the provided prompt and parameters.

Conceptual Usage Example (Python)

Here’s how you might call the Generate Custom Images with LoRA 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 = "495fcf3c-f969-48ab-9765-e2a5cd02f9ce" # Action ID for Generate Custom Images with LoRA

# Construct the input payload based on the action's requirements
payload = {
    "prompt": "10therockwyne, channeling the charm and larger-than-life persona of The Rock...",
    "modelType": "dev",
    "loraIntensity": 1,
    "enableFastMode": False,
    "inferenceSteps": 28,
    "imageResolution": "1",
    "numberOfOutputs": 2,
    "imageAspectRatio": "9:16",
    "imageOutputFormat": "webp",
    "extraLoraIntensity": 1,
    "imageOutputQuality": 80,
    "inputPromptStrength": 0.8,
    "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 snippet:

  • Replace YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key.
  • The action_id is set to the ID of the Generate Custom Images with LoRA action.
  • The payload contains the required and optional fields as per the action’s input schema.

Conclusion

The floppyve/10therockwyne Cognitive Actions provide a robust solution for generating stunning, customized images. By leveraging the Generate Custom Images with LoRA action, developers can create engaging visuals that elevate their applications. Explore the various parameters to optimize image generation for your specific needs and start innovating today!