mirror of
https://github.com/modelscope/DiffSynth-Studio.git
synced 2026-03-18 22:08:13 +00:00
update examples
This commit is contained in:
@@ -38,6 +38,20 @@ LoRA Training: [`../train/kolors/`](../train/kolors/)
|
||||
|-|-|
|
||||
|||
|
||||
|
||||
Kolors also support the models trained for SD-XL. For example, ControlNets and LoRAs. See [`kolors_with_sdxl_models.py`](./kolors_with_sdxl_models.py)
|
||||
|
||||
LoRA: https://civitai.com/models/73305/zyd232s-ink-style
|
||||
|
||||
|Base model|with LoRA (alpha=0.5)|with LoRA (alpha=1.0)|with LoRA (alpha=1.5)|
|
||||
|-|-|-|-|
|
||||
|||||
|
||||
|
||||
ControlNet: https://huggingface.co/xinsir/controlnet-union-sdxl-1.0
|
||||
|
||||
|Reference image|Depth image|with ControlNet|with ControlNet|
|
||||
|-|-|-|-|
|
||||
|||||
|
||||
|
||||
### Example: Hunyuan-DiT
|
||||
|
||||
Example script: [`hunyuan_dit_text_to_image.py`](./hunyuan_dit_text_to_image.py)
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import torch
|
||||
from diffsynth import ModelManager, FluxImagePipeline
|
||||
from diffsynth import ModelManager, FluxImagePipeline, download_models
|
||||
|
||||
|
||||
download_models(["FLUX.1-dev"])
|
||||
model_manager = ModelManager(torch_dtype=torch.bfloat16, device="cuda")
|
||||
model_manager.load_models([
|
||||
"models/FLUX/FLUX.1-dev/text_encoder/model.safetensors",
|
||||
@@ -9,10 +10,11 @@ model_manager.load_models([
|
||||
"models/FLUX/FLUX.1-dev/ae.safetensors",
|
||||
"models/FLUX/FLUX.1-dev/flux1-dev.safetensors"
|
||||
])
|
||||
|
||||
pipe = FluxImagePipeline.from_model_manager(model_manager)
|
||||
|
||||
torch.manual_seed(6)
|
||||
image = pipe(
|
||||
"Anime style. A girl with long silver hair is under water, wearing a blue dress. Her eyes are blue. Her hair is waving in the water."
|
||||
"A captivating fantasy magic woman portrait set in the deep sea. The woman, with blue spaghetti strap silk dress, swims in the sea. Her flowing silver hair shimmers with every color of the rainbow and cascades down, merging with the floating flora around her. Smooth, delicate and fair skin.",
|
||||
num_inference_steps=30
|
||||
)
|
||||
image.save("image.jpg")
|
||||
image.save("image_1024.jpg")
|
||||
|
||||
@@ -43,7 +43,7 @@ def run_kolors_with_controlnet():
|
||||
|
||||
|
||||
def run_kolors_with_lora():
|
||||
download_models(["Kolors"])
|
||||
download_models(["Kolors", "SDXL_lora_zyd232_ChineseInkStyle_SDXL_v1_0"])
|
||||
model_manager = ModelManager(torch_dtype=torch.float16, device="cuda",
|
||||
file_path_list=[
|
||||
"models/kolors/Kolors/text_encoder",
|
||||
|
||||
Reference in New Issue
Block a user