-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
132 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" | |
|
||
[project] | ||
name = "sd_tools" | ||
version = "1.2.0" | ||
version = "1.3.0" | ||
authors = [{ name = "Feng Zhou", email = "[email protected]" }] | ||
description = "command line tool for stable diffusion" | ||
license = { file = "LICENSE" } | ||
|
@@ -38,3 +38,4 @@ sdxl = "sd_tools.sdxl:main" | |
sd = "sd_tools.sd:main" | ||
pt2st = "sd_tools.misc:pt2st" | ||
st-inspect = "sd_tools.misc:st_inspect" | ||
sd-to-fp16 = "sd_tools.misc:to_fp16" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from argparse import ArgumentParser | ||
from .base import PluginBase | ||
|
||
class PluginDPO(PluginBase): | ||
|
||
def setup_args(self, parser: ArgumentParser): | ||
parser.add_argument('--dpo', type=float) | ||
|
||
def setup_pipe(self): | ||
if not self.ctx.args.dpo: | ||
return | ||
|
||
self.ctx.pipe.load_lora_weights( | ||
'radames/sdxl-turbo-DPO-LoRA', | ||
adapter_name="dpo", | ||
) | ||
self.ctx.loras.append(("dpo", self.ctx.args.dpo)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from argparse import ArgumentParser | ||
from .base import PluginBase | ||
|
||
class PluginWrong(PluginBase): | ||
|
||
def setup_args(self, parser: ArgumentParser): | ||
parser.add_argument('--wrong', type=float) | ||
|
||
def setup_pipe(self): | ||
if not self.ctx.args.wrong: | ||
return | ||
|
||
self.ctx.pipe.load_lora_weights( | ||
'minimaxir/sdxl-wrong-lora', | ||
adapter_name="wrong", | ||
) | ||
self.ctx.loras.append(("wrong", self.ctx.args.wrong)) | ||
self.ctx.pipe_opts.negative_prompt = 'wrong,' + self.ctx.pipe_opts.negative_prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from argparse import ArgumentParser | ||
from diffusers import LCMScheduler | ||
from .base import PluginBase | ||
|
||
class PluginYOSO(PluginBase): | ||
|
||
def setup_args(self, parser: ArgumentParser): | ||
parser.add_argument('--yoso', type=float) | ||
|
||
def setup_pipe(self): | ||
if not self.ctx.args.yoso: | ||
return | ||
|
||
self.ctx.pipe.scheduler = LCMScheduler.from_config(self.ctx.pipe.scheduler.config) | ||
self.ctx.pipe.load_lora_weights( | ||
'Luo-Yihong/yoso_sd1.5_lora', | ||
adapter_name="yoso", | ||
) | ||
self.ctx.loras.append(("yoso", self.ctx.args.yoso)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** @type {import('tailwindcss').Config} */ | ||
module.exports = { | ||
content: [], | ||
theme: { | ||
extend: {}, | ||
}, | ||
plugins: [], | ||
} | ||
|