Instructions to use ostris/Flex.2-preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use ostris/Flex.2-preview with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("ostris/Flex.2-preview", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
fix inpaint usage without control image
#16
by katuni4ka - opened
- pipeline.py +1 -1
pipeline.py
CHANGED
|
@@ -291,7 +291,7 @@ class Flex2Pipeline(FluxControlPipeline):
|
|
| 291 |
)
|
| 292 |
inpaint_image = self.vae.encode(inpaint_image).latent_dist.sample(generator=generator)
|
| 293 |
inpaint_latents = (inpaint_image - self.vae.config.shift_factor) * self.vae.config.scaling_factor
|
| 294 |
-
height_inpaint_image, width_inpaint_image =
|
| 295 |
|
| 296 |
inpaint_mask = self.prepare_image(
|
| 297 |
image=inpaint_mask,
|
|
|
|
| 291 |
)
|
| 292 |
inpaint_image = self.vae.encode(inpaint_image).latent_dist.sample(generator=generator)
|
| 293 |
inpaint_latents = (inpaint_image - self.vae.config.shift_factor) * self.vae.config.scaling_factor
|
| 294 |
+
height_inpaint_image, width_inpaint_image = inpaint_image.shape[2:]
|
| 295 |
|
| 296 |
inpaint_mask = self.prepare_image(
|
| 297 |
image=inpaint_mask,
|