weight: -8.0 to 8.0 ( or way more or less )
positive: large DOF (sharp background)
negative: narrow DOF (blurry background)
The original file had an sdxl meta tag that makes automatic1111 web ui only show it for sdxl. I have uploaded one with the correct meta tag. If you are having issues, download and replace the previous one with the new one and refresh your network modules.
Weight depends on starting photo, if it already has a shallow depth of field, you may need to go pretty high to remove it (10.0 to 15.0), but -5.0 to 5.0 works for most images. The image stays pretty stable even at extreme values, though it will change the composition.
Weights for this model are available in Safetensors format.
Download them in the Files & versions tab.
1from diffusers import AutoPipelineForText2Image
2import torch
3
4pipeline = AutoPipelineForText2Image.from_pretrained('runwayml/stable-diffusion-v1-5', torch_dtype=torch.float16).to('cuda')
5pipeline.load_lora_weights('ostris/depth-of-field-slider-lora', weight_name='depth_of_field_slider_v1.safetensors')
6image = pipeline('photo of a woman with light brown hair, posing for a photo, centered streets of big city ').images[0]
For more details, including weighting, merging and fusing LoRAs, check the
documentation on loading LoRAs in diffusers