CoolFace
Modelpublic

sipeed/lcm-lora-sdv1-5-320x320-maixcam2

sourceHugging Facebsd-3-clauseupdated 9mo agoView on Hugging Face
0likes
Model Card

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 name lcm-lora-sdv1-5-320x320-maixcam2 in 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):

shell
scp -r lcm-lora-sdv1-5-320x320-maixcam2/lcm-lora-sdv1-5-320x320-maixcam2 root@192.168.1.100:/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

python
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

python
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

shell
scp -r lcm-lora-sdv1-5-320x320-maixcam2/launcher.py root@192.168.1.100:/root

Text-to-Image

Login to the board's terminal and execute the following command to start the text-to-image task:

bash
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:

bash
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"