FluxLora Workflow

Cinna FluxLora Workflow

Generate high-quality images from text using LoRA models through Cinna’s FluxLora workflow. This integration builds on ComfyUI infrastructure and executes across decentralized GPUs with coordination handled by Solana.


Overview

Cinna simplifies advanced image generation using LoRA models with a Node.js SDK. You can launch FluxLora tasks for creative, stylized outputs without managing infrastructure.

This workflow uses a structured task format, built on top of ComfyUI’s visual processing graph, and executed across distributed compute nodes.


Example Request

tsCopy codeimport Cinna from 'cinna'

const cinna = new Cinna({
  apiKey: process.env['CINNA_API_KEY']
})

async function generateImage() {
  const fluxLoraTask = new FluxLoraTask({
    workflow_id: '3',
    prompt: 'A photo of GECKO with dark green skin spots playing american football, cartoon, comic, anime',
    lora_name: 'gecko',
    timeout_seconds: 300
  })

  const response = await cinna.workflow.executeWorkflowAndWaitForResult(
    fluxLoraTask,
    600000,
    3000
  )

  console.log('Generated image URL:', response.result)
}

Example Response

jsonCopy code{
  "task_id": "9034a6ca80",
  "task_type": "txt2img",
  "workflow_id": "3",
  "status": "finished",
  "timeout_seconds": 300,
  "create_timestamp": 1738916890,
  "result": "https://sequencer-v2.cinna.ai/files/flux-lora/cinna-flux-9034a6ca80.jpg",
  "miner_id": "0x737c3fcc8def561dbE0D3de8Cc3B0646574b7651",
  "queue_position": 1,
  "inference_latency": 18.42,
  "msg": ""
}

Workflow Mapping

Workflow ID
Model

3

FluxLora


Parameters

Type: FluxLoraTask

Property
Type
Required
Description

workflow_id

string

yes

ID of the workflow to execute

prompt

string

yes

Text description for image generation

lora_name

string

yes

Name of the LoRA model to apply

width

number

no

Image width (default is 680)

height

number

no

Image height (default is 1024)

steps

number

no

Number of inference steps (default is 15)

noise_seed

number

no

Seed for reproducibility (default is 966993914913986)

job_id_prefix

string

no

Custom identifier for the task

timeout_seconds

number

no

Time allowed before task is canceled

consumer_id

string

no

Optional override for consumer ID

api_key

string

no

Optional override for API key


Return Value

Type: WorkflowTaskResult

Property
Type
Description

task_id

string

Unique task identifier

status

enum

Status of the task (waiting, running, finished)

result

any

Output content or file URL

workflow_id

string

Associated workflow identifier

create_timestamp

number

Timestamp of task creation

inference_latency

number

Duration of model inference

upload_latency

number

Upload duration (if applicable)


Authentication

Authentication uses a combined consumer ID and API key in the format consumerId#apiKey. You can configure authentication in two ways:

Using environment variables in SDK initialization:

tsCopy codeconst cinna = new Cinna({
  apiKey: process.env['CINNA_API_KEY'] // Format: consumerId#apiKey
})

Or directly in the FluxLoraTask:

tsCopy codeconst fluxLoraTask = new FluxLoraTask({
  consumer_id: 'yourConsumerId',
  api_key: 'yourApiKey',
  ...
})

Task Class Definition

tsCopy codeclass FluxLoraTask extends WorkflowTask {
  constructor(options: FluxLoraTaskOptions)

  get task_type(): WorkflowTaskType.FluxLora

  get task_details(): {
    parameters: {
      prompt: string
      lora_name: string
      width?: number
      height?: number
      steps?: number
      noise_seed?: number
    }
  }
}

WorkflowTaskType Enum

tsCopy codeenum WorkflowTaskType {
  FluxLora = 'flux-lora'
}

Last updated