I am new to ML and plan to use KerasCV stabledifussion model to generate images from text. The example on the KerasCV website is straightforward but I could not find a way to save the model locally for later use. I also noticed that the library connects to hugging face to download encoder and diffusion model.

Could you please point me to the right direction to do this locally? I would like all the model and its parameters to be local and I will be using it in a server.

Also, if you have experience running such a model/server on the could, I would appreciate your guidance on the best approach wrt costs. Should I upload everything and store the whole data on the cloud or load it from hugging face? Which one would make more sense for cloud applications?




1 Answer 1


Here is how you can save a model in Keras.

model = ... # Get model (Sequential,Functional Model, or Model subclass) model.save('path/to/location.keras') #The file needs to end with the .keras extension.

Loading the model back:
model = keras.models.load_model('path/to/location.keras')


  • $\begingroup$ Please post the relevant details here. Answers consisting only of links are liable to be deleted. $\endgroup$
    – Chenmunka
    Commented Jul 9 at 16:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .