OpenWebui-Tools icon indicating copy to clipboard operation
OpenWebui-Tools copied to clipboard

Image generation/edit function for Qwen Image 2.1

Open kulbhushanchand opened this issue 1 month ago • 13 comments

Hi,

Is it possible to make the image generation/edit function for the latest Qwen Image 2.1. This model can handle both text-to-image and image-to-image.

Also, I like the part that the VRAM offloads the llm model from llama.cpp before invoking comfyui. This will help me to keep the entire model in VRAM, either llm or image model (one at a time).

Thanks

kulbhushanchand avatar Oct 19 '26 13:10 kulbhushanchand

Hey, Qwen Edit is for multiple reference images, for standard 1 refrence image you need to use QwenImage2.1 natively as the edit model in Open-Webui, Il probably make a new tool for QwenImage2.1 multiple ref images.

iChristGit avatar Oct 23 '26 19:10 iChristGit

Image

https://openwebui.com/posts/a92f6b56-72ef-4e5f-aeb7-2dae86befbe5 Feel free to test it! based on the default QwenImage2.1 workflow, 1-10 reference images. @kulbhushanchand

iChristGit avatar Oct 23 '26 19:10 iChristGit

Thanks @iChristGit for the update. I'll test and get back. Also, what I understand it is image edit tool. Can it do test to image? If not, do you have another tool for text to image with VRAM offloading? (because native OpenWebUI does not supports VRAM offloading and yours is the only one I find so far)

kulbhushanchand avatar Oct 24 '26 19:10 kulbhushanchand

4. Thanks @iChristGit for the update. I'll test and get back. Also, what I understand it is image edit tool. Can it do test to image? If not, do you have another tool for text to image with VRAM offloading? (because native OpenWebUI does not supports VRAM offloading and yours is the only one I find so far)

Il probably add to the current Qwen Image 2.1 Tool an option to just use a text2image workflow, stay tuned. Il update here once its ready, in the meanwhile test the 1-10 images ref option and tell me if all good

iChristGit avatar Oct 24 '26 19:10 iChristGit

I have just tested.

  • It worked fine and fast for a single image edit.
  • However, with 3 images merge, the VRAM and system RAM usage shoots to max and image generation took very long (~5 minutes)

kulbhushanchand avatar Oct 30 '26 13:10 kulbhushanchand

@kulbhushanchand

Hey! that which GPU? if you run the workflow normally does it get stuck? maybe use lower quants what about 2 images? is it going smooth?

iChristGit avatar Oct 30 '26 13:10 iChristGit

I use the tool-builder tool for Open WebUI and tried to fix. Now it is working fine. The issue was that the images were sent at full scale resolution to the conmfyui. One of the image has resolution of 5304 x 7952.

Please see the fix.py and the summary of the fix. You can try at your end to refine it further.

Summary of the fix.txt ram-fix.py

I have RTX 5090 32GB, along with 128 GB system RAM

Edit:

@iChristGit I just realized you are the author of the tool-builder that I used to fix the issue. That is an impressive tool. Thanks for the many useful tools you have shared in the repo...

kulbhushanchand avatar Oct 30 '26 14:10 kulbhushanchand

@iChristGit Any plan for support for text to image gen?

kulbhushanchand avatar Nov 03 '26 06:11 kulbhushanchand

9. @iChristGit Any plan for support for text to image gen?

https://github.com/iChristGit/OpenWebui-Tools/blob/main/Tools/qwenimage2.1.py

Its now up, try it, the LLM can just create images from scratch, editing stay the same

iChristGit avatar Nov 03 '26 08:11 iChristGit

@iChristGit Thanks for the update. I have checked and text to image generation is workign fine.

There can be an addition though, if we want the iterative image "gen-testing-reediting", for e.g. openwebui to test the generated image for any flaws etc. and then send it back again to the comfyui for editing. I tried and found that the Openwebui is unable to pick up the generated image with and says, The evaluation tool needs a source image to analyze, and the generated image isn't being picked up as a source. Any suggesstions in this regard?

kulbhushanchand avatar Nov 03 '26 14:11 kulbhushanchand

@kulbhushanchand

I find it better to generate and then ask for changes yourself, adding a check stage might make each generation slower by forcing the LLM to change it "wait its not vivid enough, regenerating" Thats at least my experience, and you can submit a PR , it should ge an optional toggle which is off by default to not slow down for no reason

iChristGit avatar Nov 03 '26 14:11 iChristGit

@iChristGit Yes, agreed as human in the loop may be better. Also, can you please help me understand that as of now, I have to download the image and then upload again for editing. I hope I am doing it right. Isn't the image receive by the openwebui be already available for it to analyze?

kulbhushanchand avatar Nov 03 '26 14:11 kulbhushanchand

@iChristGit Yes, agreed as human in the loop may be better. Also, can you please help me understand that as of now, I have to download the image and then upload again for editing. I hope I am doing it right. Isn't the image receive by the openwebui be already available for it to analyze?

If native tool calling is enabled and the model is smart enough its just about natural language prompting, it has access to the full history of images so you can even say something like "edit the first image and add X"

Make sure in the model settings file context is enabled as well as native tool calling

iChristGit avatar Nov 03 '26 14:11 iChristGit