SD1.5-LCM-320x320
Introduction
This repository currently only supports the 4G memory platform MaixCAM2, which is used to implement image-to-image and text-to-image tasks, and supports 320x320 resolution.
Upload the model
Upload this model folder lcm-lora-sdv1-5-320x320-maixcam2 to the device, generally upload to /root/models directory.
The repository is named
lcm-lora_sdv1-5-320x320-maixcam2, and the file with the same namelcm-lora-sdv1-5-320x320-maixcam2in the repository is the actual model file used. Get the IP address of the board method see here for details.
Use the scp command to upload the model (192.168.1.100 is the IP address of the device):
scp -r lcm-lora-sdv1-5-320x320-maixcam2/lcm-lora-sdv1-5-320x320-maixcam2 [email protected]:/root/models
Method 1 (depends on MaixPy)
Upload the model, and use MaixVision to run the following code to implement image-to-image and text-to-image tasks.
Text-to-Image
from maix import sdv1_5
model = sdv1_5.SDV1_5("/root/models/lcm-lora-sdv1-5-320x320-maixcam2/model.mud")
model.init()
model.refer(prompt="A white dog.", save_path="/root/text2img.jpg")
model.deinit()
Image-to-Image
from maix import sdv1_5
model = sdv1_5.SDV1_5("/root/models/lcm-lora-sdv1-5-320x320-maixcam2/model.mud")
model.init(img2img=True)
model.refer(prompt="Replace the dog with a cat.", init_image_path="/root/text2img.jpg", seed=1, save_path="/root/img2img.jpg")
model.deinit()
Method 2 (does not depend on MaixPy version 4.12.5 or later)
Upload launcher.py to the board
scp -r lcm-lora-sdv1-5-320x320-maixcam2/launcher.py [email protected]:/root
Text-to-Image
Login to the board's terminal and execute the following command to start the text-to-image task:
cd /root
python3 launcher.py --isize 320 --model_dir /root/models/lcm-lora-sdv1-5-320x320-maixcam2/ -o "ax620e_txt2img_axe.png" --prompt "Self-portrait oil painting, a beautiful cyborg with golden hair, 8k"
Image-to-Image
Login to the board's terminal and execute the following command to start the image-to-image task:
cd /root
python3 launcher.py --init_image /root/models/lcm-lora-sdv1-5-320x320-maixcam2/img2img-init.png --isize 320 --model_dir /root/models/lcm-lora-sdv1-5-320x320-maixcam2/ --seed 1 --prompt "Astronauts in a jungle, cold color palette, muted colors, detailed, 8k" -o "ax620e_img2img_axe.png"
Model tree for sipeed/lcm-lora-sdv1-5-320x320-maixcam2
Base model
Lykon/dreamshaper-7