Stability-AI / stability-sdk

SDK for interacting with stability.ai APIs (e.g. stable diffusion inference)
https://platform.stability.ai/
MIT License
2.41k stars 339 forks source link

Clip Guidance Not working on the API #241

Closed jfdelgad closed 1 year ago

jfdelgad commented 1 year ago

Hello, I have been using the API for about 2 months.

Today the API is returning an error when using CLIP guidance

Here is the error: details = "Exception iterating responses: 'ModelViT-L-14--openainot available, required for guidance presetGUIDANCE_PRESET_FAST_BLUE'" I switched from _FAST_BLUE to FAST_GREEN without any luck. Here is the error: {created_time:"2023-06-13T19:29:24.197403763+00:00", grpc_status:2, grpc_message:"Exception iterating responses: \'ModelViT-H-14--goodnot available, required for guidance presetGUIDANCE_PRESET_FAST_GREEN\'"}">

Removing clip guidance works, but we prefer the result provided by CLIP, any ideas?

pharmapsychotic commented 1 year ago

Yes CLIP Guidance is not supported with the SDXL engines. You should use generation.GUIDANCE_PRESET_NONE or omit the field. One of the engines was allowing the preset to be specified (and not actually performing CLIP guidance but resulting in the eta field incorrectly being changed) rather than returning an error so when that was fixed is why you started seeing the error.

pharmapsychotic commented 1 year ago

Another user ran into this and preferred the results from the changed and incorrect eta though when correcting the other settings to reduce cfg_scale to 7 I believe got the proper results and nicely match DreamStudio so you may need to check that as well. Hope this helps!