Giter Club home page Giter Club logo

Comments (5)

homevk15 avatar homevk15 commented on August 24, 2024

It would be good to have the next improvements:
1)virtualenv
2)negative prompt
3)possibility to run in Intel GPU (iGPU)
Let me know if you want to make any tests or get some donations. I'm very interested in making this project working.

from sd_pytorch2onnx.

RedAndr avatar RedAndr commented on August 24, 2024

@homevk15
Let's remove TensorFlow dependencies since the model was successfully converted to ONNX format. We can disregard the warnings for now. The issue seems to be with converting the ONNX model to OpenVINO format. As a workaround, you can comment out the conversion line in the code and instead use the Model Optimizer tool to do the conversion:
mo --input_model unet/unet.onnx --compress_to_fp16

About the negative prompt, it can be easily added. Something like that:

        bs_embed, seq_len, _ = uncond_embeddings.shape
        uncond_embeddings = uncond_embeddings.view(bs_embed, seq_len, -1)
        text_embeddings = torch.cat([uncond_embeddings, text_embeddings])

I don't have iGPU, so can't test the code on it.

from sd_pytorch2onnx.

homevk15 avatar homevk15 commented on August 24, 2024

After updating tensorflow-intel to tensorflow-intel-2.14.1 and installing openvino-dev[tensorflow2] I got success.
I got unet, text_encoder, vae_decoder, vae_encoder (.xml and .bin files).
The program didn't generate an image
I see only
Loading pipeline components...: 100%
without errors.
Do you know what to change to get an image in an output?
Also, please, update Convert_Civitai_OpenVINO with the code of negative prompt you posted. I'm new to this stuff. Thank you.

from sd_pytorch2onnx.

RedAndr avatar RedAndr commented on August 24, 2024

Yes, this code is intended only to convert a model. It doesn't generate images. For that you should use https://github.com/bes-dev/stable_diffusion.openvino

from sd_pytorch2onnx.

homevk15 avatar homevk15 commented on August 24, 2024

how opset calculated?
Is it opset = 16 for 512x512 images all the time?
After running demo.py (from https://github.com/bes-dev/stable_diffusion.openvino) with converted to OpenVINO model I got errors
Traceback (most recent call last):
File "D:\astable-diffusion\openvino_notebooks\notebooks\225-stable-diffusion-text-to-image\t6\demo.py", line 83, in
main(args)
File "D:\astable-diffusion\openvino_notebooks\notebooks\225-stable-diffusion-text-to-image\t6\demo.py", line 21, in main
scheduler = LMSDiscreteScheduler(
File "D:\Program Files\Python310\lib\site-packages\diffusers\configuration_utils.py", line 649, in inner_init
init(self, *args, **init_kwargs)
TypeError: LMSDiscreteScheduler.init() got an unexpected keyword argument 'tensor_format'
I don't know how to fix it.

from sd_pytorch2onnx.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.