Transform Your Images with Pointillism: A Guide to the rileyhacks007/sdkl-pointillism-test Actions

22 Apr 2025
Transform Your Images with Pointillism: A Guide to the rileyhacks007/sdkl-pointillism-test Actions

In the realm of creative applications, the ability to generate unique artistic styles can be a game-changer for developers. The rileyhacks007/sdkl-pointillism-test provides a powerful Cognitive Action that enables you to create or alter images in the distinctive style of Pointillism. This action supports various input parameters, allowing for customization and refinement to enhance the quality of the generated images. With its intuitive interface and flexibility, integrating this action into your applications can elevate the artistic experience for your users.

Prerequisites

To utilize the Cognitive Actions provided in this spec, you need to have an API key for the Cognitive Actions platform. This key will be used to authenticate your requests. Generally, authentication is achieved by passing the API key in the headers of your HTTP requests.

Cognitive Actions Overview

Generate Pointillism Style Image

Purpose: This action allows you to create or modify images in the style of Pointillism by specifying various parameters such as an image URI, mask, and style prompts. It supports both image-to-image (img2img) and inpainting modes, giving you flexibility in how you generate your images.

Category: image-generation

Input

The input for this action is structured as follows:

{
  "mask": "string (optional)",
  "seed": "integer (optional)",
  "image": "string (required)",
  "width": "integer (default: 1024)",
  "height": "integer (default: 1024)",
  "prompt": "string (default: 'An astronaut riding a rainbow unicorn')",
  "loraScale": "number (default: 0.6)",
  "refineStyle": "string (default: 'no_refiner')",
  "customWeights": "string (optional)",
  "guidanceScale": "number (default: 7.5)",
  "applyWatermark": "boolean (default: true)",
  "negativePrompt": "string (optional)",
  "promptStrength": "number (default: 0.8)",
  "numberOfOutputs": "integer (default: 1)",
  "refinementSteps": "integer (optional)",
  "schedulingMethod": "string (default: 'K_EULER')",
  "highNoiseFraction": "number (default: 0.8)",
  "numberOfInferenceSteps": "integer (default: 50)",
  "isSafetyCheckerDisabled": "boolean (default: false)"
}

Example Input:

{
  "width": 1024,
  "height": 1024,
  "prompt": "1960s US national park poster for yellowstone In the style of Pointillism",
  "loraScale": 0.6,
  "refineStyle": "no_refiner",
  "guidanceScale": 7.5,
  "applyWatermark": true,
  "promptStrength": 0.8,
  "numberOfOutputs": 1,
  "schedulingMethod": "K_EULER",
  "highNoiseFraction": 0.8,
  "numberOfInferenceSteps": 50
}

Output

The output will typically return a list containing the URI(s) of the generated images. Here’s an example of what you might receive:

[
  "https://assets.cognitiveactions.com/invocations/0bffc0e0-3030-4c75-a817-04b546e9c52b/7dc08ce3-d07e-427d-b114-6cfb556dec4e.png"
]

Conceptual Usage Example (Python)

Here’s how you might call the Generate Pointillism 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 = "4f90accd-f1f4-4a86-a464-408093024a3f" # Action ID for Generate Pointillism Style Image

# Construct the input payload based on the action's requirements
payload = {
    "width": 1024,
    "height": 1024,
    "prompt": "1960s US national park poster for yellowstone In the style of Pointillism",
    "loraScale": 0.6,
    "refineStyle": "no_refiner",
    "guidanceScale": 7.5,
    "applyWatermark": True,
    "promptStrength": 0.8,
    "numberOfOutputs": 1,
    "schedulingMethod": "K_EULER",
    "highNoiseFraction": 0.8,
    "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}")

Explanation of the Code:

  • Replace YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key.
  • The payload dictionary is constructed using the required input parameters for the action.
  • The request is sent as a POST to the hypothetical endpoint, and the results are printed upon successful execution.

Conclusion

The Generate Pointillism Style Image action offers developers a unique way to harness the artistic style of Pointillism in their applications. By integrating this Cognitive Action, you can allow users to create visually striking images, enhancing their creative experience. Consider exploring various parameters and use cases to fully leverage this powerful tool in your projects!