Views
No views yet
Now the pipeline has been contributed to the official diffusers community pipelines. You can use custom_pipeline="lpw_stable_diffusion_onnx" directly.
1from diffusers import DiffusionPipeline
2import torch
3
4pipe = DiffusionPipeline.from_pretrained(
5 'CompVis/stable-diffusion-v1-4',
6 custom_pipeline="waifu-research-department/onnx-long-prompt-weighting-pipeline",
7 revision="onnx",
8 provider="CUDAExecutionProvider"
9)
10pipe=pipe.to("cuda")
11
12prompt = "a photo of an astronaut riding a horse on mars, best quality"
13neg_prompt = "lowres, bad anatomy, error body, error hair, error arm, error hands, bad hands, error fingers, bad fingers, missing fingers, error legs, bad legs, multiple legs, missing legs, error lighting, error shadow, error reflection, text, error, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry"
14
15pipe.text2img(prompt, width=512,height=512,negative_prompt=neg_prompt,max_embeddings_multiples=3).images[0]Token indices sequence length is longer than the specified maximum sequence length for this model ( 108 > 77 ) . Running this sequence through the model will result in indexing errors