# LDM-SRtuning **Repository Path**: shancx/ldm-srtuning ## Basic Information - **Project Name**: LDM-SRtuning - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-04-27 - **Last Updated**: 2025-04-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Latent Diffusion Models This repo is used as an example for training and finetuning [latent-diffusion](https://github.com/CompVis/latent-diffusion) used as the baseline in [StableSR](https://github.com/IceClear/StableSR). ## Requirements A suitable [conda](https://conda.io/) environment named `ldm` can be created and activated with: ``` conda env create -f environment.yaml conda activate ldm ``` ## Pretrained Models You can download our finetuned model [[HuggingFace](https://huggingface.co/Iceclear/StableSR/resolve/main/ldmsr4x_finetune_119.ckpt) | [OpenXLab](https://download.openxlab.org.cn/models/Iceclear/StableSR/weight//ldmsr4x_finetune_119.ckpt)]. ## Train ``` python main.py --base configs/bsr_sr/config_sr_finetune.yaml -t --gpus 0, --train --scale_lr False ``` ## Inference We use eta=1.0 as a type of DDPM using the offical DDIM sampling code. ``` python scripts/sr_val_ddim_realsr.py --config configs/bsr_sr/config_sr_finetune.yaml --ckpt CKPT_PATH --outdir OUTPUT_PATH --skip_grid --ddim_steps 200 --init-img INPUT_PATH --ddim_eta 1.0 --color_fix ``` ## Acknowledgement This repo is an extension built on [latent-diffusion](https://github.com/openai/guided-diffusion). Some codes are also borrowing from [BasicSR](https://github.com/XPixelGroup/BasicSR). Thanks for open-sourcing!