mirror of
https://github.com/modelscope/DiffSynth-Studio.git
synced 2026-03-19 06:32:27 +00:00
support artaug
This commit is contained in:
12
examples/ArtAug/README.md
Normal file
12
examples/ArtAug/README.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# ArtAug
|
||||
|
||||
ArtAug is an approach designed to improve text-to-image synthesis models through synthesis-understanding interactions. We have trained an ArtAug enhancement module for FLUX.1-dev in the format of LoRA. See [`./artaug_flux.py`](./artaug_flux.py).
|
||||
|
||||
|FLUX.1-dev|FLUX.1-dev + ArtAug LoRA|
|
||||
|-|-|
|
||||
|||
|
||||
|||
|
||||
|||
|
||||
|||
|
||||
|||
|
||||
|||
|
||||
24
examples/ArtAug/artaug_flux.py
Normal file
24
examples/ArtAug/artaug_flux.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import torch
|
||||
from diffsynth import ModelManager, FluxImagePipeline, download_customized_models
|
||||
|
||||
prompt = "a beautiful Asian girl."
|
||||
|
||||
# Generate an image using FLUX.1-dev
|
||||
model_manager = ModelManager(torch_dtype=torch.bfloat16, device="cuda", model_id_list=["FLUX.1-dev"])
|
||||
pipe = FluxImagePipeline.from_model_manager(model_manager)
|
||||
|
||||
image = pipe(prompt=prompt, seed=0)
|
||||
image.save("image.jpg")
|
||||
|
||||
# Download ArtAug LoRA
|
||||
lora_path = download_customized_models(
|
||||
model_id="DiffSynth-Studio/ArtAug-lora-FLUX.1dev-v1",
|
||||
origin_file_path="merged_lora.safetensors",
|
||||
local_dir="models/lora",
|
||||
downloading_priority=["ModelScope", "HuggingFace"]
|
||||
)[0]
|
||||
model_manager.load_lora(lora_path, lora_alpha=1.0)
|
||||
|
||||
# Generate an image using FLUX.1-dev + ArtAug
|
||||
image = pipe(prompt=prompt, seed=0)
|
||||
image.save("image_artaug.jpg")
|
||||
Reference in New Issue
Block a user