DiffSynth-Studio/FLUX.1-Kontext-dev-lora-ArtAug

🤗 Hugging Face 来源apache-2.0153M 参数306 MBsafetensors✓ 28 个校验和今天更新
一条命令提交

在你的模型文件夹旁边运行它。它会制作种子、将文件与 Hugging Face 比对,然后提交。你只需开始做种,并粘贴你账户中的密钥。它只读取你的文件,绝不修改。如果愿意,可以先阅读脚本。

curl -fsSL https://pirateface.co/package.sh | bash -s -- --repo DiffSynth-Studio/FLUX.1-Kontext-dev-lora-ArtAug ./model-folder
需要做种者 →

Aesthetic Enhancement - Kontext Image Editing LoRA

Model Introduction

This LoRA model is trained based on the Kontext model and DiffSynth-Studio. After using this model, you can input the instruction Enhance the aesthetic quality of this image. to enhance the aesthetic quality of an image. The model automatically analyzes aspects such as lighting and composition based on the image content and adjusts them to make the image more visually appealing. This model can be applied repeatedly, meaning you can perform aesthetic enhancement multiple times on an already enhanced image.

Model Results

Example 1 Example 2 Example 3
Original
1st Enhancement
2nd Enhancement
3rd Enhancement
Example 4 Example 5 Example 6
Original
1st Enhancement
2nd Enhancement
3rd Enhancement

Usage Instructions

This model is built on the DiffSynth-Studio framework. Please install it first:

git clone https://github.com/modelscope/DiffSynth-Studio.git  
cd DiffSynth-Studio
pip install -e .
import torch
from diffsynth.pipelines.flux_image_new import FluxImagePipeline, ModelConfig
from PIL import Image
from modelscope import snapshot_download
snapshot_download("DiffSynth-Studio/FLUX.1-Kontext-dev-lora-ArtAug", cache_dir="./models")
pipe = FluxImagePipeline.from_pretrained(
    torch_dtype=torch.bfloat16,
    device="cuda",
    model_configs=[
        ModelConfig(model_id="black-forest-labs/FLUX.1-Kontext-dev", origin_file_pattern="flux1-kontext-dev.safetensors"),
        ModelConfig(model_id="black-forest-labs/FLUX.1-dev", origin_file_pattern="text_encoder/model.safetensors"),
        ModelConfig(model_id="black-forest-labs/FLUX.1-dev", origin_file_pattern="text_encoder_2/"),
        ModelConfig(model_id="black-forest-labs/FLUX.1-dev", origin_file_pattern="ae.safetensors"),
    ],
)
pipe.load_lora(pipe.dit, "models/DiffSynth-Studio/FLUX.1-Kontext-dev-lora-ArtAug/model.safetensors", alpha=1)

image = Image.open("your_image.jpg")
image = pipe(
    prompt="Enhance the aesthetic quality of this image.",
    kontext_images=image,
    embedded_guidance=2.5,
    seed=0,
)
image.save("output.jpg")