Model Training
-
Use at least 10-12 high quality images.
-
Ensure size of images is 512x512 px for training on SD-1.5 and 1024x1024 px for SDXL.
-
Try to use a base model that is trained for the kind of images you have trained with. For example, here since the images are of a human, Realistic Vision is being used.
-
Experiment with the Guidance Scale and LoRA weights (start from 0.5)
- Train Model
- Public Model Status
ENDPOINT:
https://api.imagepipeline.io/train_model/v1/
AUTHORIZATION: API-Key
JSON BODY:
{
"model_name": "Nisha",
"model_type": "lora",
"base_model": "sd1.5",
"max_train_steps": 150,
"validation_prompt": "Nisha woman ",
"images": ["https://i.ibb.co/pdzjRdH/1.png", "https://i.ibb.co/tKhJv1n/2.png", "https://i.ibb.co/Z1qfc9q/3.png", "https://i.ibb.co/XDnyLKd/4.png", "https://i.ibb.co/zP9DtPj/5.png", "https://i.ibb.co/zP9DtPj/5.png", "https://i.ibb.co/Q8WDksv/7.png"],
"trigger_words": "nisha",
"description": "trained to make images of nisha",
"tags": "lora, SD1.5",
"nsfw": false,
"visibility": "private"
}
ENDPOINT:
https://api.imagepipeline.io/train_model/status/{{task_id}}
AUTHORIZATION: API-Key
Body needs to be set to none
Sync model
Once the training is complete, you will need to sync the model to use it.
- Sync Models
ENDPOINT:
https://api.imagepipeline.io/sync_model/v1
AUTHORIZATION: API-Key
JSON BODY:
{
"model_id": "Model ID"
}
Generate images
You can use the generation API endpoints to pass all the parameters to generate the image by passing the model_id
in the lora_models
parameter.
- Generate Image
ENDPOINT:
https://api.imagepipeline.io/sd/text2image/v1/
AUTHORIZATION: API-Key
JSON BODY:
{
"model_id": "b1d00402-b0eb-4d7d-9fbf-f27fcd49c7c0",
"prompt": "Nisha woman close up in sparkling princess gown in a forest",
"negative_prompt": "error, cropped, worst quality, low quality, duplicate, blurry, (unfinished objects), stock image, artifacts, blurry face, ((deformed eyes)), ((deformed face)), bad proportion, (deformed iris), too many fingers",
"num_inference_steps": 20,
"refiner": false,
"samples": 4,
"guidance_scale": 5,
"width": 512,
"height": 512,
"lora_models": ["8157a4c5-065b-4183-81ce-6b5238e073d6"],
"lora_weights": ["0.7"]
}
JSON Parameters
Parameter | Type | Allowed Values |
---|---|---|
model_name | str | |
model_type | str | "lora" |
base_model | str | "sd1.5", "sdxl" |
max_train_steps | int | (0, 2000] |
validation_prompt | str | |
images | str, array | |
trigger_words | str | Trigger words |
description | str | |
tags | str | Optional comma-separated tags |
nsfw | boolean | Whether model is not safe for work. |
visibility | str | "private", "public" |