# 79th Place Solution: Using stable-diffusion-cpp-python

First, I had compiled
llama-cpp-python
for a previous Kaggle competition, so I decided to use
stable-diffusion-cpp-python
in this competition.
My plan was simple: use
FLUX.1-schnell Q6_K
with
stable-diffusion-cpp-python
to outperform SD-based or more heavily quantized FLUX.1-based solutions.
For conversion to compliant SVG, I used VTracer and Scour. To optimize parameters within the time limit, I used binary search and SSIM-based comparison.
However, the biggest problem was that the image generation was much slower than I expected — over 55 seconds on the first image! I tried to use the following patch for T4 x2 GPUs, but it didn’t work well:
[#461 Ability to split model components to different backend devices](https://github.com/leejet/stable-diffusion.cpp/pull/461)
The bug may come from the following issue so I attempted to avoid NaNs that occurred when running on CUDA, but it was too complicated, and I wasn't able to solve it.
[#636 CLIP: Using CPU Backend despite configuring for CUDA](https://github.com/leejet/stable-diffusion.cpp/issues/636)
Due to time constraints, I couldn’t really pay attention to optimizing VQA or aesthetic scores. The prompt I used was
"{original prompt}, simple toon vector image, monoline, icon style, limited color palette, aesthetic"
but it was just a heuristic, and I didn’t test it thoroughly. The score varied a lot with different seeds.
Additionally, I used three nearly fixed-position OCR decoy and
[CLIP-GmP-ViT-L-14](https://huggingface.co/zer0int/CLIP-GmP-ViT-L-14)
— a fine-tuned version of the CLIP model — for stabilizing the score. They were also heuristic and not well tested, so I don't know how good they are.
The Final Code:
[https://www.kaggle.com/code/toshimitsukimura/79th-place-solution-flux-1-schnell-vtracer-scour](https://www.kaggle.com/code/toshimitsukimura/79th-place-solution-flux-1-schnell-vtracer-scour)