Train LoRA
flux-lora-trainer
flux-lora-trainer is a versatile model that allows users to train custom LoRA models for image generation. It's ideal for those who want to create personalized AI models tailored to their specific needs and styles.
Example: Train a Custom LoRA Model with flux-lora-trainer
# Install the FlyMyAI package
# pip install flymyai
from flymyai import client, FlyMyAIPredictException
# Set secret api key. You can find your api key in the profile settings
apikey = "fly-***"
# Set the model name
model = "flymyai/flux-lora-trainer"
# Prepare the input data
payload = {
"lora_name": "Hello World",
"trigger_word": "Hello World",
"dataset_url": "undefined",
"training_steps": 1000,
"huggingface_model_name": "black-forest-labs/FLUX.1-dev"
}
# Initialize the client
fma_client = client(apikey=apikey)
try:
response = fma_client.predict(
model=model,
payload=payload
)
# Process the output data
print(f"model: {response.output_data['model']}")
print(f"config: {response.output_data['config']}")
except FlyMyAIPredictException as e:
print(e)
raise e