Rookie Q: Minimal example to generate images with negative prompts
Awesome work for those of us who don't like the (late 2010s) photographic (bokeh?) effect of Flux
Do you have a minimal example script?
It works out off the shelf, but I'm looking for one using negative prompt :)
Thanks in advance for any pointer!
For reference, I tried negative_prompt
without success
pipe = FluxPipeline.from_pretrained(
"black-forest-labs/FLUX.1-dev",
torch_dtype=torch.bfloat16,
# device_map="balanced",
)
settings = {
"num_images_per_prompt":args.num_images_per_prompt, "max_sequence_length":512,
"width":512, "height":512
}
settings["negative_prompt"] = "painting, smooth"
pipe.load_lora_weights("kudzueye/boreal-flux-dev-v2")
pipe.fuse_lora(lora_scale=0.8)
seed = int(time.time())
generator = torch.Generator(device="cuda").manual_seed(seed)
images = pipe(**settings, generator=generator, prompt=prompt).images
I do not believe negative prompts have any effect on the Flux Dev diffusers pipeline as it is a distilled model though my knowledge may be outdated.
I do not have any example diffusers scripts for Flux as I probably only used it directly during training. You can search around to see any one else made some examples scripts with other loras.
There are also some ComfyUI workflows that would for instance used Dynamic Thresholding to get something of a negative prompt working (sort of) like this example: https://www.youtube.com/watch?v=f8MnpkeFYtU
Forge may also have a similar approach though I have not looked at it lately. Though overall, I have usually just avoided negative prompts as is for all Flux dev generations.
Gotcha, thanks for chiming in! I checked 10s images without negative prompts & lgtm. Thus, I agree with your take & given that you're the owner I'll close the comment.
For reference (in case others wanna try it out), I found a CFGFluxPipeline (github gist) that might use negative prompt.