Update README.md
Browse files
README.md
CHANGED
@@ -19,15 +19,15 @@ widget:
|
|
19 |
- text: transform the setting to a winter scene
|
20 |
output:
|
21 |
url: >-
|
22 |
-
https://huggingface.co/datasets/sayakpaul/sample-datasets/resolve/main/flux-edit-artifacts/
|
23 |
- text: turn the color of mushroom to gray
|
24 |
output:
|
25 |
url: >-
|
26 |
-
https://huggingface.co/datasets/sayakpaul/sample-datasets/resolve/main/flux-edit-artifacts/
|
27 |
- text: Change it to look like it's in the style of an impasto painting.
|
28 |
output:
|
29 |
url: >-
|
30 |
-
https://huggingface.co/datasets/sayakpaul/sample-datasets/resolve/main/flux-edit-artifacts/
|
31 |
---
|
32 |
|
33 |
# Flux Edit
|
@@ -53,13 +53,14 @@ from diffusers import FluxControlPipeline, FluxTransformer2DModel
|
|
53 |
from diffusers.utils import load_image
|
54 |
import torch
|
55 |
|
56 |
-
path = "sayakpaul/FLUX.1-dev-edit-v0"
|
57 |
edit_transformer = FluxTransformer2DModel.from_pretrained(path, torch_dtype=torch.bfloat16)
|
58 |
pipeline = FluxControlPipeline.from_pretrained(
|
59 |
"black-forest-labs/FLUX.1-dev", transformer=edit_transformer, torch_dtype=torch.bfloat16
|
60 |
).to("cuda")
|
61 |
|
62 |
-
|
|
|
63 |
print(image.size)
|
64 |
|
65 |
prompt = "turn the color of mushroom to gray"
|
@@ -91,7 +92,7 @@ from diffusers.utils import load_image
|
|
91 |
from huggingface_hub import hf_hub_download
|
92 |
import torch
|
93 |
|
94 |
-
path = "sayakpaul/FLUX.1-dev-edit-v0"
|
95 |
edit_transformer = FluxTransformer2DModel.from_pretrained(path, torch_dtype=torch.bfloat16)
|
96 |
pipeline = FluxControlPipeline.from_pretrained(
|
97 |
"black-forest-labs/FLUX.1-dev", transformer=edit_transformer, torch_dtype=torch.bfloat16
|
@@ -103,7 +104,9 @@ pipeline.load_lora_weights(
|
|
103 |
)
|
104 |
pipeline.set_adapters(["hyper-sd"], adapter_weights=[0.125])
|
105 |
|
106 |
-
|
|
|
|
|
107 |
print(image.size)
|
108 |
|
109 |
prompt = "turn the color of mushroom to gray"
|
|
|
19 |
- text: transform the setting to a winter scene
|
20 |
output:
|
21 |
url: >-
|
22 |
+
https://huggingface.co/datasets/sayakpaul/sample-datasets/resolve/main/flux-edit-artifacts/edited_green_creature.jpg
|
23 |
- text: turn the color of mushroom to gray
|
24 |
output:
|
25 |
url: >-
|
26 |
+
https://huggingface.co/datasets/sayakpaul/sample-datasets/resolve/main/flux-edit-artifacts/edited_mushroom.jpg
|
27 |
- text: Change it to look like it's in the style of an impasto painting.
|
28 |
output:
|
29 |
url: >-
|
30 |
+
https://huggingface.co/datasets/sayakpaul/sample-datasets/resolve/main/flux-edit-artifacts/edited_norte_dam.jpg
|
31 |
---
|
32 |
|
33 |
# Flux Edit
|
|
|
53 |
from diffusers.utils import load_image
|
54 |
import torch
|
55 |
|
56 |
+
path = "sayakpaul/FLUX.1-dev-edit-v0"
|
57 |
edit_transformer = FluxTransformer2DModel.from_pretrained(path, torch_dtype=torch.bfloat16)
|
58 |
pipeline = FluxControlPipeline.from_pretrained(
|
59 |
"black-forest-labs/FLUX.1-dev", transformer=edit_transformer, torch_dtype=torch.bfloat16
|
60 |
).to("cuda")
|
61 |
|
62 |
+
url = "https://huggingface.co/datasets/sayakpaul/sample-datasets/resolve/main/flux-edit-artifacts/assets/mushroom.jpg"
|
63 |
+
image = load_image(url) # resize as needed.
|
64 |
print(image.size)
|
65 |
|
66 |
prompt = "turn the color of mushroom to gray"
|
|
|
92 |
from huggingface_hub import hf_hub_download
|
93 |
import torch
|
94 |
|
95 |
+
path = "sayakpaul/FLUX.1-dev-edit-v0"
|
96 |
edit_transformer = FluxTransformer2DModel.from_pretrained(path, torch_dtype=torch.bfloat16)
|
97 |
pipeline = FluxControlPipeline.from_pretrained(
|
98 |
"black-forest-labs/FLUX.1-dev", transformer=edit_transformer, torch_dtype=torch.bfloat16
|
|
|
104 |
)
|
105 |
pipeline.set_adapters(["hyper-sd"], adapter_weights=[0.125])
|
106 |
|
107 |
+
|
108 |
+
url = "https://huggingface.co/datasets/sayakpaul/sample-datasets/resolve/main/flux-edit-artifacts/assets/mushroom.jpg"
|
109 |
+
image = load_image(url) # resize as needed.
|
110 |
print(image.size)
|
111 |
|
112 |
prompt = "turn the color of mushroom to gray"
|