Generate Stunning Image Variations with the workroomprds/jamesbooth1 Cognitive Actions

24 Apr 2025
Generate Stunning Image Variations with the workroomprds/jamesbooth1 Cognitive Actions

In the realm of digital creativity, the workroomprds/jamesbooth1 Cognitive Actions offer powerful tools that enable developers to harness image generation capabilities. Among these tools is the ability to create variations of images using Stablebooth, a model pre-trained on images of James. This integration not only allows for customization through prompts but also provides various settings to achieve the desired aesthetic and quality. By leveraging these pre-built actions, developers can enrich their applications with advanced image manipulation features effortlessly.

Prerequisites

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

  • An API key for the Cognitive Actions platform.
  • Basic knowledge of making HTTP requests in your preferred programming language.

Authentication typically involves passing the API key in the request headers, ensuring secure access to the actions provided.

Cognitive Actions Overview

Generate Image Variations with Stablebooth

This action allows you to generate variations of images using Stablebooth, focusing on customization through various parameters such as prompts and settings.

Category: Image Generation

Input

The input for this action is structured as follows:

  • seed (optional): An integer that initializes the random number generator. Leave it blank to randomize.
  • image (optional): URI of the starting image for generating variations.
  • width: Specifies the output image width (default: 512). Selectable values are between 128 and 1024.
  • height: Specifies the output image height (default: 512). Selectable values are between 128 and 1024.
  • prompt: Text prompt guiding the image generation (default: "a photo of a workroomprds person").
  • scheduler: Selects the scheduling algorithm for image generation (default: "DDIM").
  • guidanceScale: Defines the scale for classifier-free guidance (default: 7.5, range: 1-20).
  • negativePrompt (optional): Specifies elements to exclude from the generated output.
  • promptStrength: Determines the influence of the initial image when used (default: 0.8, range: 0-1).
  • numberOfOutputs: Number of images to generate (default: 1, range: 1-4).
  • disableSafetyCheck: Toggles safety checks (default: false).
  • numberOfInferenceSteps: Specifies the number of denoising steps (default: 50, range: 1-500).

Example Input:

{
  "width": 512,
  "height": 512,
  "prompt": "a compelling HDR silverpoint photo of a workroomprds person",
  "scheduler": "DDIM",
  "guidanceScale": 7.5,
  "promptStrength": 0.8,
  "numberOfOutputs": 1,
  "numberOfInferenceSteps": 50
}

Output

The action typically returns an array of URLs pointing to the generated images.

Example Output:

[
  "https://assets.cognitiveactions.com/invocations/d6e9235b-660c-475d-b441-e7ab38434fdf/94200c53-d7c9-4462-98d1-4a4c7cb500b8.png"
]

Conceptual Usage Example (Python)

Here’s a conceptual Python snippet demonstrating how to call the action:

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 = "e0942e50-c4c2-4698-8581-8f48e0e047ac"  # Action ID for Generate Image Variations with Stablebooth

# Construct the input payload based on the action's requirements
payload = {
    "width": 512,
    "height": 512,
    "prompt": "a compelling HDR silverpoint photo of a workroomprds person",
    "scheduler": "DDIM",
    "guidanceScale": 7.5,
    "promptStrength": 0.8,
    "numberOfOutputs": 1,
    "numberOfInferenceSteps": 50
}

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 own. The payload variable is constructed to match the expected input for generating image variations. The request is then sent to the hypothetical endpoint, and the response is handled appropriately.

Conclusion

The workroomprds/jamesbooth1 Cognitive Actions offer a robust solution for developers looking to implement advanced image generation capabilities into their applications. By using the Generate Image Variations with Stablebooth action, you can create personalized and unique images tailored to your specific needs. Explore the potential of integrating these actions and enhance your projects with creative image variations today!