Views
No views yet
pip install -U diffusers transformers torch sentencepiece peft controlnet-aux moviepy protobuf1#import os
2#os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com'
3
4#### git clone https://huggingface.co/ostris/Flex.2-preview
5
6import torch
7from diffusers import AutoPipelineForText2Image
8from diffusers.utils import load_image
9
10#name_or_path = "ostris/Flex.2-preview"
11name_or_path = "Flex.2-preview"
12dtype = torch.bfloat16
13
14pipe = AutoPipelineForText2Image.from_pretrained(
15 name_or_path,
16 custom_pipeline=name_or_path,
17 torch_dtype=dtype
18)
19#### OR pipe.load_lora_weights("Chinese_idol_Flex2_lora/my_first_flex2_lora_v1_000003500.safetensors") 3500 ~ 4500
20pipe.load_lora_weights("Chinese_idol_Flex2_lora/my_first_flex2_lora_v1_000004500.safetensors")
21pipe.enable_model_cpu_offload()
22
23import numpy as np
24from PIL import Image
25image = pipe(
26 prompt="a young Asian male singer with fair skin and black, slightly messy hair, performing on stage. He wears a white, slightly wrinkled, long-sleeved shirt with a black tie and a black emblem on the left chest. He holds a black microphone in his right hand and a black headset in his left. The background is dark with colorful, out-of-focus bokeh lights in green, purple, and yellow. His expression is confident, with a slight smile.",
27 inpaint_image=Image.fromarray(np.zeros((1024, 1024, 3)).astype(np.uint8)),
28 inpaint_mask=Image.fromarray(np.ones((1024, 1024, 3), dtype=np.uint8) * 255),
29 control_image=Image.fromarray(np.zeros((1024, 1024, 3)).astype(np.uint8)),
30 control_strength=0.5,
31 control_stop=0.33,
32 height=1024,
33 width=1024,
34 guidance_scale=3.5,
35 num_inference_steps=50,
36 generator=torch.Generator("cpu").manual_seed(477)
37).images[0]
a young Asian male singer with fair skin and black, slightly tousled hair. He is wearing a black school blazer with a white shirt and a blue striped tie. The blazer has a crest on the left chest pocket. He has a black earpiece in his left ear and is mid-singing, with his mouth slightly open and eyes looking forward. The background is a soft blue gradient with subtle light and shadow patterns, suggesting a stage setting. The overall image has a professional, polished look typical of concert or music show photography. The lighting is even, highlighting his face and upper body.
a young Asian male with pale skin and short, dark brown hair, slightly tousled. He is wearing a black formal suit jacket with a white dress shirt and a navy blue striped tie. His eyes are closed, and he has a serene, slightly tilted head with a subtle smile. He has black earbuds in his ears. The background is blurred, featuring green and white colors, suggesting an outdoor setting. The suit has a small, white embroidered emblem on the left chest. The image has a soft, natural light, highlighting his youthful and elegant appearance. The overall style is modern and polished.



1sudo apt-get update && sudo apt-get install git-lfs
2
3git clone https://huggingface.co/svjack/Flux_Anime_Landscape_Lora
4git clone https://huggingface.co/svjack/Genshin_Impact_VENTI_Flex2_Lora
5git clone https://huggingface.co/svjack/Genshin_Impact_XIAO_Flex2_Lora
6git clone https://huggingface.co/svjack/Genshin_Impact_ZHONGLI_Flex2_Lora1import torch
2from diffusers import FluxPipeline
3
4pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
5pipe.load_lora_weights("Chinese_idol_Flex2_lora/my_first_flex2_lora_v1_000004500.safetensors")
6pipe.load_lora_weights("Flux_Anime_Landscape_Lora/my_first_flux_lora_v1_000001500.safetensors")
7#pipe.enable_sequential_cpu_offload()
8pipe.enable_model_cpu_offload()
9
10prompt = "anime style ,a young Asian male singer with fair skin and black, slightly messy hair, performing on stage. He wears a white, slightly wrinkled, long-sleeved shirt with a black tie and a black emblem on the left chest. He holds a black microphone in his right hand and a black headset in his left. The background is dark with colorful, out-of-focus bokeh lights in green, purple, and yellow. His expression is confident, with a slight smile."
11
12image = pipe(prompt,
13 num_inference_steps=50,
14 guidance_scale=3.5,
15 ).images[0]
1import torch
2from diffusers import FluxPipeline
3
4pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
5pipe.load_lora_weights("Chinese_idol_Flex2_lora/my_first_flex2_lora_v1_000004500.safetensors")
6pipe.load_lora_weights("Flux_Anime_Landscape_Lora/my_first_flux_lora_v1_000001500.safetensors")
7pipe.load_lora_weights("Genshin_Impact_VENTI_Flex2_Lora/my_first_flex2_lora_v1_000001750.safetensors")
8pipe.enable_sequential_cpu_offload()
9#pipe.enable_model_cpu_offload()
10
11prompt = "anime style, VENTI ,a young Asian male singer with fair skin and black, slightly messy hair, performing on stage. He wears a white, slightly wrinkled, long-sleeved shirt with a black tie and a black emblem on the left chest. He holds a black microphone in his right hand and a black headset in his left. The background is dark with colorful, out-of-focus bokeh lights in green, purple, and yellow. His expression is confident, with a slight smile."
12
13image = pipe(prompt,
14 num_inference_steps=50,
15 guidance_scale=3.5,
16 ).images[0]
1import torch
2from diffusers import FluxPipeline
3
4pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
5pipe.load_lora_weights("Chinese_idol_Flex2_lora/my_first_flex2_lora_v1_000004500.safetensors")
6pipe.load_lora_weights("Flux_Anime_Landscape_Lora/my_first_flux_lora_v1_000001500.safetensors")
7pipe.load_lora_weights("Genshin_Impact_XIAO_Flex2_Lora/my_first_flex2_lora_v1_000002000.safetensors")
8pipe.enable_sequential_cpu_offload()
9#pipe.enable_model_cpu_offload()
10
11prompt = "anime style, XIAO ,a young Asian male singer with fair skin and black, slightly tousled hair. He is wearing a black school blazer with a white shirt and a blue striped tie. The blazer has a crest on the left chest pocket. He has a black earpiece in his left ear and is mid-singing, with his mouth slightly open and eyes looking forward. The background is a soft blue gradient with subtle light and shadow patterns, suggesting a stage setting. The overall image has a professional, polished look typical of concert or music show photography. The lighting is even, highlighting his face and upper body."
12
13image = pipe(prompt,
14 num_inference_steps=50,
15 guidance_scale=3.5,
16 ).images[0]
1import torch
2from diffusers import FluxPipeline
3
4pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
5pipe.load_lora_weights("Chinese_idol_Flex2_lora/my_first_flex2_lora_v1_000004500.safetensors")
6pipe.load_lora_weights("Flux_Anime_Landscape_Lora/my_first_flux_lora_v1_000001500.safetensors")
7pipe.load_lora_weights("Genshin_Impact_ZHONGLI_Flex2_Lora/my_first_flex2_lora_v1_000002000.safetensors")
8pipe.enable_sequential_cpu_offload()
9#pipe.enable_model_cpu_offload()
10
11prompt = "anime style, ZhongLi ,a young Asian male with pale skin and short, dark brown hair, slightly tousled. He is wearing a black formal suit jacket with a white dress shirt and a navy blue striped tie. His eyes are closed, and he has a serene, slightly tilted head with a subtle smile. He has black earbuds in his ears. The background is blurred, featuring green and white colors, suggesting an outdoor setting. The suit has a small, white embroidered emblem on the left chest. The image has a soft, natural light, highlighting his youthful and elegant appearance. The overall style is modern and polished."
12
13image = pipe(prompt,
14 num_inference_steps=50,
15 guidance_scale=3.5,
16 ).images[0]
17