butaixianran / Stable-Diffusion-Webui-Civitai-Helper

Stable Diffusion Webui Extension for Civitai, to manage your model much more easily.
2.37k stars 286 forks source link

Added a crude translator for Civitai-Meta-Data #277

Closed nosdregamon closed 4 months ago

nosdregamon commented 4 months ago

The Civitai-Generator doesn't offer some Meta-Data used by A1111 in favor of it's own format.

For example: https://civitai.com/images/8010475 includes [{"type":"checkpoint","modelVersionId":290640},{"type":"lora","weight":1,"modelVersionId":349887},{"type":"embed","weight":1,"modelVersionId":5637}] but no usual "Model hash" or lora-prompts that A1111 and Forge rely upon.

image

Loading this picture into A1111 and using "Paste" results in an entirely different picture, missing lots of styles.

image

I added a little bit of Javascript that asks Civitai via XHR which models are hidden behind "modelVersionId" and tries to re-create the missing sources. You basically have to throw in the picture(a usual), hit a new button, an after this you hit paste:

image

This currently only works with pictures dropped into txt2img and img2img's prompt field - I couldn't get it to work in "Png-Info" so far, but independently of that, the results are pretty close to the original style (I guess as close as differences in Hardware and Software-Versions allow):

image

butaixianran commented 4 months ago

This extension only handle model's preview image. Any other images from civitai is not a business of this extension. You should add your function to sd webui, or create a new extension for it.