Skip to content

skl0726/LFPS-Style

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Content Preservation by Low-frequency Phase Swapping in Diffusion-based Style Transfer

⚠️ Research in Progress ⚠️

Model Diagram (Initial Version)

Result (Initial Version)

The left image is the original, the center image shows the result with a text prompt, and the right image shows the result with low-frequency phase swapping. (cutoff_ratio = 0.2)

  • LDM text prompt: "Oil Panting"


  • LDM text prompt: "Monochrome Sketching"

Getting Started

Prerequisites

conda env create -f environment.yaml
conda activate stable-diffusion

Stable Diffusion & CLIP Weights

mkdir -p models/ldm/stable-diffusion-v1
ln -s <path/to/model.ckpt> models/ldm/stable-diffusion-v1/model.ckpt 
git lfs install
mkdir -p models/clip
cd models/clip
git clone https://huggingface.co/openai/clip-vit-large-patch14

Run

cutoff_ratio (hyperparameters that control the range of low-frequency) can be modified from the ldm/models/diffusion/ddim.py file (0.0 <= cutoff_ratio <= 1.0).
(Will be updated to adjust cutoff_ratio at run stage)

python scripts/img2img.py --prompt <your_style_prompt> --init-img <your_content_img_dir> --outdir <your_output_folder_dir> --strength 0.8

About

Content Preservation by Low‐frequency Phase Swapping in Diffusion‐based Style Transfer

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 8