Stability-AI / stability-sdk

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

Malloc error? #212

Open maschinenzeitmaschine opened 1 year ago

maschinenzeitmaschine commented 1 year ago

Hi, I'm using the reference code from https://platform.stability.ai/docs/features/text-to-image?tab=python and sometimes it does work as intended, but about half of the runs (in a seemingly random fashion), Python crashes with the following error message:

Python(13180,0x1712a7000) malloc: Corruption of free object 0x142738330: msizes 8/7 disagree Python(13180,0x1712a7000) malloc: *** set a breakpoint in malloc_error_break to debug

The mysterious part is, this happens AFTER the created image has successfully been saved to disk – I get the image, and then the malloc crash. I don't think it's rest of my program, as it works perfectly well if I replace the Stability api call with DALL-E, imagenAIry etc. – it only happens when using stability-sdk. Versions are stability-sdk 0.4.0, Python 3.10.10 (Flask app), Macos 13.13 (M1). Any ideas anyone?

maschinenzeitmaschine commented 1 year ago

Update, not a solution, but if someone should have the same problem: I just used the REST API, that works fine and there is even a Python code example: https://platform.stability.ai/rest-api#tag/v1generation/operation/textToImage