Update README.md
Browse files
README.md
CHANGED
|
@@ -108,7 +108,7 @@ def prepare_masked_image(
|
|
| 108 |
mask_norm = np.stack([mask_norm] * 3, axis=-1)
|
| 109 |
|
| 110 |
# Combine: keep original pixels where mask=0, use noisy_bg where mask=1
|
| 111 |
-
combined = ((1 - mask_norm) *
|
| 112 |
|
| 113 |
return Image.fromarray(combined)
|
| 114 |
|
|
@@ -116,8 +116,8 @@ def prepare_masked_image(
|
|
| 116 |
def main():
|
| 117 |
"""Entry point for running the FluxFill pipeline."""
|
| 118 |
# Load input image and its corresponding mask
|
| 119 |
-
fg_mask = load_image("https://huggingface.co/rkv1990/FLUX.1-Fill-dev-outpainting/resolve/main/beauty-products-mask.png")
|
| 120 |
-
input_image= load_image("https://huggingface.co/rkv1990/FLUX.1-Fill-dev-outpainting/resolve/main/beauty-products.png")
|
| 121 |
|
| 122 |
masked_image = prepare_masked_image(foreground=input_image, mask=fg_mask)
|
| 123 |
|
|
@@ -129,7 +129,7 @@ def main():
|
|
| 129 |
|
| 130 |
# Run the pipeline
|
| 131 |
output = pipe(
|
| 132 |
-
prompt="
|
| 133 |
image=masked_image,
|
| 134 |
mask_image=fg_mask,
|
| 135 |
height=1024,
|
|
|
|
| 108 |
mask_norm = np.stack([mask_norm] * 3, axis=-1)
|
| 109 |
|
| 110 |
# Combine: keep original pixels where mask=0, use noisy_bg where mask=1
|
| 111 |
+
combined = ((1 - mask_norm) * noisy_bg + mask_norm * foreground_np).astype(np.uint8)
|
| 112 |
|
| 113 |
return Image.fromarray(combined)
|
| 114 |
|
|
|
|
| 116 |
def main():
|
| 117 |
"""Entry point for running the FluxFill pipeline."""
|
| 118 |
# Load input image and its corresponding mask
|
| 119 |
+
fg_mask = load_image("https://huggingface.co/rkv1990/FLUX.1-Fill-dev-outpainting/resolve/main/beauty-products-mask.png").convert("L")
|
| 120 |
+
input_image= load_image("https://huggingface.co/rkv1990/FLUX.1-Fill-dev-outpainting/resolve/main/beauty-products.png").convert("RGB")
|
| 121 |
|
| 122 |
masked_image = prepare_masked_image(foreground=input_image, mask=fg_mask)
|
| 123 |
|
|
|
|
| 129 |
|
| 130 |
# Run the pipeline
|
| 131 |
output = pipe(
|
| 132 |
+
prompt="A mist-covered forest at dawn, with pale golden light filtering through ancient, twisted trees. Soft fog swirls around delicate wildflowers glowing faintly with bioluminescence.",
|
| 133 |
image=masked_image,
|
| 134 |
mask_image=fg_mask,
|
| 135 |
height=1024,
|