MCPcopy Index your code
hub / github.com/modelscope/DiffSynth-Studio / build_pipeline

Function build_pipeline

examples/EntityControl/entity_transfer.py:8–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6
7
8def build_pipeline():
9 model_manager = ModelManager(torch_dtype=torch.bfloat16, device="cuda", model_id_list=["FLUX.1-dev"])
10 model_manager.load_lora(
11 download_customized_models(
12 model_id="DiffSynth-Studio/Eligen",
13 origin_file_path="model_bf16.safetensors",
14 local_dir="models/lora/entity_control"
15 ),
16 lora_alpha=1
17 )
18 model_manager.load_lora(
19 download_customized_models(
20 model_id="iic/In-Context-LoRA",
21 origin_file_path="visual-identity-design.safetensors",
22 local_dir="models/lora/In-Context-LoRA"
23 ),
24 lora_alpha=1
25 )
26 pipe = FluxImagePipeline.from_model_manager(model_manager)
27 return pipe
28
29
30def generate(pipe: FluxImagePipeline, source_image, target_image, mask, height, width, prompt, entity_prompt, image_save_path, mask_save_path, seed=0):

Callers 1

entity_transfer.pyFile · 0.85

Calls 4

load_loraMethod · 0.95
ModelManagerClass · 0.90
from_model_managerMethod · 0.45

Tested by

no test coverage detected