blog icon indicating copy to clipboard operation
blog copied to clipboard

lora api suppot prompt and negative prompt together?

Open heiheiwangergou opened this issue 2 years ago • 1 comments

model_path = "pcuenq/pokemon-lora"

info = model_info(model_path) model_base = info.cardData["base_model"] pipe = StableDiffusionPipeline.from_pretrained(model_base, torch_dtype=torch.float16) pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)

pipe.unet.load_attn_procs(model_path) pipe.to("cuda")

image = pipe("Green pokemon with menacing face", num_inference_steps=25).images[0] image.save("green_pokemon.png")

pipe("Green pokemon with menacing face", suppot prompt and negative prompt together?

heiheiwangergou avatar Oct 26 '23 02:10 heiheiwangergou

Hello! The example shows a regular generation prompt, you can add a negative prompt using negative_prompt as an additional argument in the call to pipe():

image = pipe("Green pokemon with menacing face", negative_prompt="low queality", num_inference_steps=25).images[0]

pcuenca avatar Oct 26 '23 07:10 pcuenca