Issues with models from Civitai

I appreciate all the work you’re doing on this repository, I was hoping it to be my only requirement but it looks like I have to use automatic1111’s web ui backend or something. On the website https://civitai.com/ you can download SD models. Not a single model on that website whether it be .safetenors or .ckpt files I ever got working on the docker-diffusers template. Either the notebook crashes entirely, or, when I convert it to diffusers first on a space of the website of HuggingFace, the model is just broken. I have no idea why they do work on the web ui.

Thanks, man, appreciate it.

Is this all with recent docker-diffusers-api versions? Say :dev releases? I’m all the time updating the version of diffusers we use (and dependencies), and it often has fixes for this kind of thing.

Having said that, I’ve never personally tried using any models from civitai. This is definitely something I’d like to support, so will be happy to look into this, however, I have a really long list of important things I’m slowly working through, so it’s hard to commit to a time yet. Would you like to spend some time on this before I start on the LoRA training stuff?

Some options if you have time to spend on this before I do:

  1. check with latest :dev release, if conversion works.
  2. open an issue on Issues · huggingface/diffusers · GitHub with full details including link to the civitai model, any errors you see, etc. they might want you to provide a reproduction in pure diffusers though, maybe.

Also, just wanted to double check that we’re talking about full SD models (as I understood from your message) and not just the LoRA weights. I don’t think there’s any way to currently use LoRA safetensor weights at least but there’s a PR on that started yesterday at Adding support for `safetensors` and LoRa. by Narsil · Pull Request #2448 · huggingface/diffusers · GitHub.

Curious, how are you pointing to the CivitAI models? Are you pulling down locally and adding it to the container somewhere or at build time? I have only seen support for HF.

@gadicc Are there any examples of using custom ckpts? I can do the fine tuning locally but I don’t know how to get that into diffusers-api with the given docs?

@tehfailsafe

All you need to do is provide the URL to your .ckpt checkpoint in the dockerfile and it will automatically download it for you.
ARG CHECKPOINT_URL=“https://yoursite.com/models/yourmodel.ckpt

As the MODEL_ID, you can use any name but I highly recommend using the same name as checkpoint filename without the file extension. (so in this case ‘yourmodel’)

When you call the API, simply provide that MODEL_ID as the model and it will work out of the box.

1 Like

Welcome, @tehfailsafe!

As the awesome @jochemstoel says, you just need to set CHECKPOINT_URL (and MODEL_ID to something unique).

Open to suggestions on how to make this clearer in the docs. It’s mentioned briefly in the readme and in Using custom checkpoint (.ckpt) files.

Thanks :slight_smile:

@gadicc When I download a picke tensor from CivitAI, pruned or unpruned, your image builds successfully but no matter what scheduler I use, I get these types of results:

Do you have any idea why this is? If you can tell me how to fix this, that’d be awesome.

Haven’t seen that before :confused: I understand it’s every model you’ve tried from there? But either way send me a direct link so I can experiment locally and try figure out what’s going on. Weird! I had a quick look for any mention of civitai in diffusers issues and didn’t see anything specific. But let me play around a bit and see if I can figure anything out. In the logs is it running all the num_inference_steps ?