# FluxLora Workflow

Generate images from text descriptions using LoRA models with advanced AI.

This workflow extends the base ComfyUI Workflow functionality to support text-to-image generation using LoRA models.

## [​](https://docs.heurist.ai/dev-guide/heurist-sdk/comfyui-fluxlora#example-request)Example Request <a href="#example-request" id="example-request"></a>

Copy

```
import Xalora from 'xalora'

const xalora = new Xalora({
  apiKey: process.env['XALORA_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 // optional
  });

  const response = await Xalora.workflow.executeWorkflowAndWaitForResult(
    fluxLoraTask,
    600000,  // 10 minutes timeout
    3000     // 3 seconds polling interval
  );

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

## [​](https://docs.heurist.ai/dev-guide/heurist-sdk/comfyui-fluxlora#example-response)Example Response <a href="#example-response" id="example-response"></a>

Copy

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

## [​](https://docs.heurist.ai/dev-guide/heurist-sdk/comfyui-fluxlora#workflow-id-mapping)Workflow ID Mapping <a href="#workflow-id-mapping" id="workflow-id-mapping"></a>

| Workflow ID | Model    |
| ----------- | -------- |
| 3           | FluxLora |

## [​](https://docs.heurist.ai/dev-guide/heurist-sdk/comfyui-fluxlora#parameters)Parameters <a href="#parameters" id="parameters"></a>

**Type**: `FluxLoraTask`

| Property         | Type   | Required | Description                                                                                               |
| ---------------- | ------ | -------- | --------------------------------------------------------------------------------------------------------- |
| workflow\_id     | string | true     | The ID of the workflow to execute.                                                                        |
| prompt           | string | true     | The prompt to use for the video generation.                                                               |
| lora\_name       | string | true     | The name of the LoRA model to use.                                                                        |
| width            | number | false    | The width of the image. Default is 680.                                                                   |
| height           | number | false    | The height of the image. Default is 1024.                                                                 |
| steps            | number | false    | The number of steps to use for the image generation. Default is 15.                                       |
| noise\_seed      | number | false    | The seed to use for the image generation. Default is 966993914913986.                                     |
| job\_id\_prefix  | string | false    | An optional prefix for the job ID. Default is “sdk-workflow”.                                             |
| timeout\_seconds | number | false    | The timeout for the task in seconds. If the task is not finished within the timeout, it will be canceled. |
| consumer\_id     | string | false    | The ID of the consumer.                                                                                   |
| api\_key         | string | false    | The API key of the consumer.                                                                              |

## [​](https://docs.heurist.ai/dev-guide/heurist-sdk/comfyui-fluxlora#returns)Returns <a href="#returns" id="returns"></a>

**Type**: `WorkflowTaskResult`

| Property           | Type   | Required | Description                                    |
| ------------------ | ------ | -------- | ---------------------------------------------- |
| task\_id           | string | true     | The ID of the executed task.                   |
| status             | enum   | true     | The status of the task.                        |
| result             | any    | false    | The result of the task, if available.          |
| task\_details      | any    | false    | The details of the task, if available.         |
| timeout\_seconds   | number | false    | The timeout for the task in seconds.           |
| workflow\_id       | string | false    | The ID of the workflow that executed the task. |
| create\_timestamp  | number | false    | The timestamp when the task was created.       |
| inference\_latency | number | false    | The latency of the inference in seconds.       |
| upload\_latency    | number | false    | The latency of the upload in seconds.          |

## [​](https://docs.heurist.ai/dev-guide/heurist-sdk/comfyui-fluxlora#authentication)Authentication <a href="#authentication" id="authentication"></a>

Authentication uses a combined consumer ID and API key format: `consumerId#apiKey`. You can provide these in two ways:

1. In the Xalora client initialization using environment variables:

Copy

```
const Xalora = new Xalora({
  apiKey: process.env['XALORA_API_KEY']  // format: consumerId#apiKey
});
```

2. In the `FluxLoraTask` object, the task-specific values will override the client defaults if provided.

Copy

```
const fluxLoraTask = new FluxLoraTask({
  consumer_id: 'consumerId',
  api_key: 'apiKey',
  ...
});
```

## [​](https://docs.heurist.ai/dev-guide/heurist-sdk/comfyui-fluxlora#types)Types <a href="#types" id="types"></a>

`FluxLoraTask`

A class representing a FluxLora task, extending the abstract `WorkflowTask` class.

Copy

```
class 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`

An enum representing the types of workflow tasks.

Copy

```
enum WorkflowTaskType {
  FluxLora = 'flux-lora'
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xalora-ai.gitbook.io/xalora-ai-docs/fluxlora-workflow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
