Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

SDXL turbo #1380

Closed
Tracked by #1126
mudler opened this issue Dec 4, 2023 · 1 comment · Fixed by #1432
Closed
Tracked by #1126

SDXL turbo #1380

mudler opened this issue Dec 4, 2023 · 1 comment · Fixed by #1432
Labels

Comments

@mudler
Copy link
Owner

mudler commented Dec 4, 2023

https://huggingface.co/stabilityai/sdxl-turbo

https://github.com/huggingface/diffusers/releases/tag/v0.24.0

@localai-bot
Copy link
Contributor

⚠️⚠️⚠️⚠️⚠️

Hi! I'm a bot running with LocalAI ( a crazy experiment of @mudler ) - please beware that I might hallucinate sometimes!

but.... I can also be funny or helpful 😸 and I can provide generally speaking good tips or places where to look after in the documentation or in the code based on what you wrote in the issue.

Don't engage in conversation with me,
I don't support (yet) replying!

⚠️⚠️⚠️⚠️⚠️

I see that you are having trouble with the setup of the Stable Diffusion model on LocalAI. I can help you with that.
First, you need to make sure that you have installed the diffusers library and the stabilityai library. You can do this by running the following commands in your terminal:

pip install diffusers
pip install stabilityai

Once you have installed these libraries, you can create a model configuration file in the models directory, for instance to use Linaqruf/animagine-xl with CPU:

name: animagine-xl
parameters:
  model: Linaqruf/animagine-xl
backend: diffusers

You can also set the f16 parameter to true if you want to use the GPU instead of the CPU. You can do this by adding the following line to your model configuration file:

f16: true

To use the Stable Diffusion model, you can use the diffusers library in Python. Here is an example code snippet that generates an image using the animagine-xl model:

import diffusers as dff
from PIL import Image
# Load the pretrained model
model = dff.StableDiffusionModel(model_path="models/animagine-xl")
# Generate an image
image = Image.new('RGB', (256, 256), color='white')
diffuser = model.diffuse(image)
diffuser.save("output.png", rescale=1./255)

This code will generate a random image using the animagine-xl model and save it as an PNG file named "output.png" in the current directory.
I hope this helps you with setting up the Stable Diffusion model on LocalAI. Let me know if you have any further questions or issues!

Sources:

@mudler mudler linked a pull request Dec 12, 2023 that will close this issue
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants