|
| 1 | +--- |
| 2 | +title: Running the LCM-LoRA-SDv1-5 Model on MaixPy MaixCAM |
| 3 | +update: |
| 4 | + - date: 2025-12-03 |
| 5 | + author: lxowalle |
| 6 | + version: 1.0.0 |
| 7 | + content: Added LCM-LoRA-SDv1-5 code and documentation |
| 8 | +--- |
| 9 | + |
| 10 | +## Supported Devices |
| 11 | + |
| 12 | +| Device | Supported | |
| 13 | +| -------- | ------- | |
| 14 | +| MaixCAM2 | ✅ | |
| 15 | +| MaixCAM | ❌ | |
| 16 | + |
| 17 | + |
| 18 | +## Introduction to the LCM-LoRA-SDv1-5 Model |
| 19 | + |
| 20 | +LCM-LoRA-SDv1-5 is a model that supports text-to-image and image-to-image generation, based on the StableDiffusion 1.5 LCM project. With this model, you can generate conceptual images for artistic creation—simply provide a text description, and the model will generate an image based on it. |
| 21 | + |
| 22 | +## Running the LCM-LoRA-SDv1-5 Model on MaixPy MaixCAM |
| 23 | + |
| 24 | +### Model and Download Link |
| 25 | + |
| 26 | +If the `LCM-LoRA-SDv1-5` model is not present in the system directory `/root/models` by default, you need to download it manually. |
| 27 | + |
| 28 | + * Memory requirement: CMM memory 1 GiB. For details, refer to the [Memory Usage Documentation](../pro/memory.md) |
| 29 | + |
| 30 | + * Download link: https://huggingface.co/sipeed/lcm-lora-sdv1-5-maixcam2 |
| 31 | + |
| 32 | +For the download method, refer to the instructions in the [Qwen documentation](../pro/memory.md) |
| 33 | + |
| 34 | +### Running the Model |
| 35 | + |
| 36 | +Refer to `launcher.py` in the model directory to run the model. |
| 37 | + |
| 38 | +#### Text-to-Image |
| 39 | +```shell |
| 40 | +cd lcm-lora-sdv1-5-maixcam2 |
| 41 | +python3 launcher.py --isize 256 --model_dir ax620e_models/ -o "ax620e_txt2img_axe.png" --prompt "a white dog" |
| 42 | +``` |
| 43 | + |
| 44 | +Parameter description: |
| 45 | +- `--isize`: Input image size, recommended value is 256 |
| 46 | +- `--model_dir`: Model directory |
| 47 | +- `-o`: Output image filename |
| 48 | +- `--prompt`: Description text; the model generates an image based on this description |
| 49 | + |
| 50 | +#### Image-to-Image |
| 51 | +```shell |
| 52 | +cd lcm-lora-sdv1-5-maixcam2 |
| 53 | +python3 launcher.py --init_image ax620e_models/img2img-init.png --isize 256 --model_dir ax620e_models/ --seed 1 --prompt "Change to black clothes" -o "ax620e_img2img_axe.png" |
| 54 | +``` |
| 55 | + |
| 56 | +Parameter description: |
| 57 | +- `--init_image`: Initial image; the model generates a new image based on this |
| 58 | +- `--isize`: Input image size, recommended value is 256 |
| 59 | +- `--model_dir`: Model directory |
| 60 | +- `--seed`: Random seed, controls randomness during image generation |
| 61 | +- `-o`: Output image filename |
| 62 | +- `--prompt`: Description text; the model generates an image based on this description |
| 63 | + |
| 64 | + |
0 commit comments