Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

diffusers: add esrgan #917

Open
mudler opened this issue Aug 17, 2023 · 2 comments
Open

diffusers: add esrgan #917

mudler opened this issue Aug 17, 2023 · 2 comments
Labels
enhancement New feature or request high prio roadmap up for grabs Tickets that no-one is currently working on

Comments

@mudler
Copy link
Owner

mudler commented Aug 17, 2023

Add esrgan support to enhance image output size.

https://huggingface.co/stabilityai/stable-diffusion-x4-upscaler

@mudler mudler added the enhancement New feature or request label Aug 17, 2023
@mudler mudler self-assigned this Aug 17, 2023
@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!

⚠️⚠️⚠️⚠️⚠️

To add ESRGAN support for enhancing the image output size, you can use the following steps:

  1. Install the StableDiffusionXL model from the huggingface transformers library using the pip install command in your terminal:
pip install transformers==4.0.0
  1. Add the ESRGAN backend to the LocalAI configuration file in the models directory, under the diffusers section:
# Use ESRGAN for image output size enhancement
diffusers:
  pipeline_type: StableDiffusionXLPipeline
  cuda: false # Enable for GPU usage (CUDA)
  scheduler_type: EulerAncestralDiscreteScheduler
  esrgan: true
  1. Use the esrgan parameter in the image generation request to enable the output size enhancement:
curl http://localhost:8080/v1/images/generations \
    -H "Content-Type: application/json" \
    -d '{
      "prompt": "<positive prompt>|<negative prompt>", 
      "model": "animagine-xl", 
      "step": 51,
      "size": "1024x1024",
      "esrgan": true
    }'

This will generate an image with enhanced output size using the ESRGAN backend.

Sources:

@mudler mudler added the roadmap label Sep 14, 2023
@mudler mudler added the up for grabs Tickets that no-one is currently working on label Jan 5, 2024
@mudler mudler removed their assignment Jan 5, 2024
@LeonSijiaLu
Copy link
Contributor

Hello @mudler , I would want to try taking on this ticket.

Before I begin, I wanted to clarify my understandings. I think the primary goal is to update Diffusers to take on an additional boolean field Upscaler. If this field is set to true, we'll update the python server to utilize the 'StableDiffusionUpscalePipeline'. Please correct me if you think I misunderstood.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high prio roadmap up for grabs Tickets that no-one is currently working on
Projects
None yet
Development

No branches or pull requests

3 participants