This repository has been archived by the owner on Oct 8, 2024. It is now read-only.
Replies: 4 comments
-
Your changes has been manually added to my branch, so I've closed your pull request. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you |
Beta Was this translation helpful? Give feedback.
0 replies
-
@azuritecoin I found that there is a community script for using weighted prompts & long prompts using the Onnx Pipline. Figured you might be interested. Example: from diffusers import DiffusionPipeline
from diffusers.schedulers import DDIMScheduler, LMSDiscreteScheduler, PNDMScheduler
import torch
height = 512
width = 512
num_inference_steps = 50
guidance_scale = 7.5
scheduler = PNDMScheduler(beta_start=0.00085, beta_end=0.012, beta_schedule="scaled_linear")
generator = torch.Generator()
seed = generator.seed()
generator = generator.manual_seed(seed)
latents = torch.randn(
(1, 4, height // 8, width // 8),
generator = generator
)
pipe = DiffusionPipeline.from_pretrained(
'./models/sd-onnx-v1-5',
custom_pipeline="lpw_stable_diffusion_onnx",
provider="DmlExecutionProvider",
torch_dtype="auto",
scheduler=scheduler
)
pipe.safety_checker = lambda images, **kwargs: (images, False)
prompt = "best_quality (1girl:1.3) bow bride brown_hair closed_mouth frilled_bow frilled_hair_tubes frills (full_body:1.3) fox_ear hair_bow hair_tubes happy hood japanese_clothes kimono long_sleeves red_bow smile solo tabi uchikake white_kimono wide_sleeves cherry_blossoms"
neg_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"
image = pipe.text2img(prompt, negative_prompt = neg_prompt, width = width, height = height, num_inference_steps = num_inference_steps, latents = latents, max_embeddings_multiples=3).images[0]
image.save("./" + str(seed) + ".png") |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
[Deleted]
Edit: Created a pull request instead: #5
Beta Was this translation helpful? Give feedback.
All reactions