wanghaofan commited on
Commit
34e81d5
1 Parent(s): 35f8df2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +26 -0
README.md CHANGED
@@ -57,6 +57,32 @@ image = pipe(prompt,
57
  image.save(f"example.png")
58
  ```
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
 
61
  ## Acknowledgements
62
  This model is trained by our copyrighted users [DynamicWang](https://www.shakker.ai/userpage/dfca7abc67c04a9492ea738d864de070/publish). We release this model under permissions. The model follows [flux-1-dev-non-commercial-license](https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md) and the generated images are also non commercial.
 
57
  image.save(f"example.png")
58
  ```
59
 
60
+ ## LoRA Inference
61
+ To save memory, we also add a LoRA version to achieve same performance.
62
+
63
+ ```python
64
+ import torch
65
+ from diffusers import FluxPipeline
66
+
67
+ pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
68
+ pipe.load_lora_weights('Shakker-Labs/AWPortrait-FL', weight_name='FLUX-dev-lora-AWPortrait-FL.safetensors')
69
+ pipe.fuse_lora(lora_scale=0.9)
70
+ pipe.to("cuda")
71
+
72
+ prompt = "close up portrait, Amidst the interplay of light and shadows in a photography studio,a soft spotlight traces the contours of a face,highlighting a figure clad in a sleek black turtleneck. The garment,hugging the skin with subtle luxury,complements the Caucasian model's understated makeup,embodying minimalist elegance. Behind,a pale gray backdrop extends,its fine texture shimmering subtly in the dim light,artfully balancing the composition and focusing attention on the subject. In a palette of black,gray,and skin tones,simplicity intertwines with profundity,as every detail whispers untold stories."
73
+
74
+ image = pipe(prompt,
75
+ num_inference_steps=24,
76
+ guidance_scale=3.5,
77
+ width=768, height=1024,
78
+ ).images[0]
79
+ image.save(f"example.png")
80
+ ```
81
+
82
+ ## Online Inference
83
+
84
+ You can also download this model at [Shakker AI](https://www.shakker.ai/modelinfo/baa0dc46adb34547860a17a571065c9d?from=feed), where we provide an online interface to generate images.
85
+
86
 
87
  ## Acknowledgements
88
  This model is trained by our copyrighted users [DynamicWang](https://www.shakker.ai/userpage/dfca7abc67c04a9492ea738d864de070/publish). We release this model under permissions. The model follows [flux-1-dev-non-commercial-license](https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md) and the generated images are also non commercial.