alvarobartt HF staff commited on
Commit
16613d0
1 Parent(s): b20d658

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +31 -0
README.md CHANGED
@@ -82,6 +82,37 @@ You should use the following format:
82
  Ghibli style [character description] with [distinctive features], [action or pose], [environment or background], [lighting or atmosphere], [additional details]` to trigger the image generation.
83
  ```
84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  ## Disclaimer
86
 
87
  The FLUX.1-dev fine-tunes fall under the same license as FLUX.1-dev i.e. https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md; and the Studio Ghibli dataset is "licensed" with a custom non-commercial license based on the findings on their website.
 
82
  Ghibli style [character description] with [distinctive features], [action or pose], [environment or background], [lighting or atmosphere], [additional details]` to trigger the image generation.
83
  ```
84
 
85
+ ## Inference with `diffusers`
86
+
87
+ ```python
88
+ import torch
89
+ from diffusers import DiffusionPipeline
90
+
91
+ model_id = "black-forest-labs/FLUX.1-dev"
92
+ adapter_id = "alvarobartt/ghibli-characters-flux-lora"
93
+
94
+ pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16)
95
+ pipeline.load_lora_weights(adapter_id)
96
+ pipeline.to("cuda")
97
+
98
+ prompt = (
99
+ "Ghibli style futuristic stormtrooper with glossy white armor and a sleek helmet,"
100
+ " standing heroically on a lush alien planet, vibrant flowers blooming around, soft"
101
+ " sunlight illuminating the scene, a gentle breeze rustling the leaves"
102
+ )
103
+
104
+ image = pipeline(
105
+ prompt=prompt,
106
+ num_inference_steps=30,
107
+ width=1024,
108
+ height=768,
109
+ guidance_scale=3.5,
110
+ lora_scale=1.0,
111
+ ).images[0]
112
+
113
+ image.save("ghibli.png", format="PNG")
114
+ ```
115
+
116
  ## Disclaimer
117
 
118
  The FLUX.1-dev fine-tunes fall under the same license as FLUX.1-dev i.e. https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md; and the Studio Ghibli dataset is "licensed" with a custom non-commercial license based on the findings on their website.