fofr / cog-comfyui

Run ComfyUI with an API
https://replicate.com/fofr/any-comfyui-workflow
MIT License
544 stars 124 forks source link

Feature request: custom (self-trained) LoRA support #97

Closed felixding closed 4 months ago

felixding commented 5 months ago

Custom LoRA support is essential for many use cases. For example, we train and use custom LoRAs for each customer's product. We currently use SDXL + custom LoRAs on Replicate but are considering switching to cog-comfyui for greater flexibility and customization. The only roadblock now is the lack of custom LoRA support.

By the way, it can be something like https://github.com/pkpkTech/ComfyUI-TemporaryLoader integrated.

fofr commented 4 months ago

I've added an initial way to upload weights to models. I need to double back and make it compatible/flexible with Replicate trained loras (which will be a weight you can pass in at runtime rather than needing to do a training each time)

Details of new feature:

Ok, I've shipped a new feature that lets you upload:

You need to use HuggingFace or CivitAI urls

https://replicate.com/fofr/any-comfyui-workflow/train

Check the training logs to see what filenames to use in your workflow JSON. For example:

Downloading from HuggingFace:
...
Size of the tar file: 217.88 MB
====================================
When using your new model, use these filenames in your JSON workflow:
araminta_k_midsommar_cartoon.safetensors
felixding commented 4 months ago

Wow! This is fantastic.

Thank you!

I'll try it out as soon I get back home.