Skip to main content
POST
/
image-lora-models
/
create
JavaScript
import Weights from '@weights-ai/sdk';

const client = new Weights({
  bearerToken: 'My Bearer Token',
});

const imageLoraModel = await client.imageLoraModels.create({
  images: [
    { url: 'https://example.com/image1.jpg' },
    { url: 'https://example.com/image1.jpg' },
    { url: 'https://example.com/image1.jpg' },
    { url: 'https://example.com/image1.jpg' },
    { url: 'https://example.com/image1.jpg' },
  ],
  name: 'My Custom Style',
});

console.log(imageLoraModel.id);
{
  "id": "<string>",
  "trainingJobId": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required

Name of the LoRA model

Required string length: 1 - 100
Examples:

"My Custom Style"

images
object[]
required

Array of training images (5-30 images required)

Required array length: 5 - 30 elements
Examples:
[]
triggerWord
string

Trigger word to activate the LoRA model

Examples:

"my_style"

Response

Returns the ID of the created image LoRA training job.

id
string
required
trainingJobId
string
required
I