GeorgeQi commited on
Commit
3c26371
·
verified ·
1 Parent(s): f2d7ee1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +73 -3
README.md CHANGED
@@ -1,3 +1,73 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - flux
4
+ - text-to-image
5
+ - iclora
6
+ - diffusers
7
+ - fal
8
+ widget:
9
+ - text: "an intricately designed perfume bottle resting on a vintage carved dressing table, flanked by elegant makeup and jewelry, with a gilded mirror above and a vase of peonies adding a romantic ambiance, all depicted in a refined vintage style."
10
+ output:
11
+ url: pictures/t2i_1.png
12
+ - text: "A lively image featuring a bottle of alcopop on a sleek bar counter, a bokeh effect of an enthusiastic crowd and a live band with colorful stage lighting in the background, all wrapped up in a vivid urban nightlife ambiance"
13
+ output:
14
+ url: pictures/t2i_2.png
15
+ - text: "A luxurious crossbody bag is the centerpiece on a glass shelf, with a selection of high-end accessories neatly arrayed behind it, all bathed in a soft, diffused sunlight that adds a serene and exquisite touch to the image."
16
+ output:
17
+ url: pictures/t2i_3.png
18
+ - text: "The table is placed in an outdoor camping scene with a teapot and two teacups on the table, grass, outdoor, sunlight, HD, product photography."
19
+ output:
20
+ url: pictures/t2i_4.png
21
+ - text: "A bottle is placed in water, the water covers half of the product, the splash flies, the bottom half of the product placed under the water is clearly visible, waterproof advertising, product advertising, photography, HD, real, 8k"
22
+ output:
23
+ url: pictures/t2i_5.png
24
+ - text: "A photo of a serene landscape with a calm lake reflecting the surrounding mountains and forests. The mountains have a mix of tree and exposed rock. The sky is overcast, with dark clouds covering the sky. The reflection of the mountains and sky on the lake is mirror-clear. The shoreline is lined with trees. The ground is covered with grass."
25
+ output:
26
+ url: pictures/t2i_6.png
27
+
28
+ base_model: black-forest-labs/FLUX.1-dev
29
+ license: other
30
+ license_name: flux-1-dev-non-commercial-license
31
+ license_link: https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md
32
+ ---
33
+ # Color-Patette-Flux_dev
34
+ ## Inference
35
+ <Gallery />
36
+
37
+ ```python
38
+
39
+ import torch
40
+ import cv2
41
+ from PIL import Image
42
+ import numpy as np
43
+ from diffusers.utils import load_image
44
+ from diffusers.pipelines.flux.pipeline_flux_controlnet import FluxControlNetPipeline
45
+ from diffusers.models.controlnet_flux import FluxControlNetModel
46
+
47
+ controlnet_model_path = './flux_controlnet_artistic_text'
48
+ controlnet = FluxControlNetModel.from_pretrained(controlnet_model, torch_dtype=torch.bfloat16)
49
+ pipe = FluxControlNetPipeline.from_pretrained('black-forest-labs/FLUX.1-dev',
50
+ controlnet=controlnet,
51
+ torch_dtype=torch.bfloat16).to("cuda")
52
+
53
+
54
+ font_mask_pil = Image.open(font_mask_path)
55
+ font_mask_npy = np.array(font_mask_pil)
56
+ if len(font_mask_npy.shape) == 2:
57
+ font_mask_npy = cv2.cvtColor(font_mask_npy, cv2.COLOR_GRAY2RGB)
58
+ font_mask_pil = Image.fromarray(font_mask_npy)
59
+
60
+ prompt = "Vibrant, multicolored lettering against a soft, pastel background, with the letters appearing to be made of delicate petals and blooming flowers, giving a sense of freshness and natural beauty. The texture should mimic the intricate layers and velvety surfaces of various blossoms, with subtle gradients and occasional dewdrops enhancing the lifelike appearance."
61
+ image = pipe(prompt,
62
+ control_image=font_mask_pil,
63
+ controlnet_conditioning_scale=0.6,
64
+ num_inference_steps=30,
65
+ guidance_scale=3.5,
66
+ generator=torch.Generator("cuda").manual_seed(42)).images[0]
67
+ image.save("./result.png")
68
+ ```
69
+
70
+
71
+ # Training
72
+
73
+ Training was done using https://github.com/huggingface/diffusers/blob/main/examples/controlnet/train_controlnet_flux.py