Skip to content

Commit

Permalink
feature/fix: migrate to pydantic 2.3
Browse files Browse the repository at this point in the history
 - test: add schema tests/fuzzer and fixes
 - fix default prompt. add tests
 - fix outpaint and controlnet defaults
 - fix init image strength defaults
  • Loading branch information
brycedrennan committed Sep 17, 2023
1 parent 8e956f5 commit 7c2004b
Show file tree
Hide file tree
Showing 14 changed files with 830 additions and 172 deletions.
6 changes: 3 additions & 3 deletions docs/examples/immortal_pearl_earring.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ def generate_image_morph_video():
transcendence_weight = (max(year - 2050, 0) / 3) * robotic_weight
subprompts = [
WeightedPrompt(
f"{year_txt} professional {color_txt} headshot photo of a woman with a pearl earring wearing an {year_txt} outfit. {scene}",
text=f"{year_txt} professional {color_txt} headshot photo of a woman with a pearl earring wearing an {year_txt} outfit. {scene}",
weight=pearl_weight + 0.1,
),
WeightedPrompt(
"photo of a cybernetic woman computer chips in her head. circuits, cybernetic, robotic, biomechanical, elegant, sharp focus, highly detailed, intricate details. scenic majestic mountains of mars in the background",
text="photo of a cybernetic woman computer chips in her head. circuits, cybernetic, robotic, biomechanical, elegant, sharp focus, highly detailed, intricate details. scenic majestic mountains of mars in the background",
weight=robotic_weight + 0.01,
),
WeightedPrompt(
"photo of a cybernetic woman floating above a wormhole. computer chips in her head. circuits, cybernetic, robotic, biomechanical, elegant, sharp focus, highly detailed, intricate details",
text="photo of a cybernetic woman floating above a wormhole. computer chips in her head. circuits, cybernetic, robotic, biomechanical, elegant, sharp focus, highly detailed, intricate details",
weight=transcendence_weight,
),
]
Expand Down
4 changes: 4 additions & 0 deletions imaginairy/cli/imagine.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,7 @@ def imagine_cmd(
caption_text,
control_inputs=control_inputs,
)


if __name__ == "__main__":
imagine_cmd() # noqa
4 changes: 3 additions & 1 deletion imaginairy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,13 @@ class ControlNetConfig:
),
]

CONTROLNET_CONFIG_SHORTCUTS = {m.short_name: m for m in CONTROLNET_CONFIGS}
CONTROLNET_CONFIG_SHORTCUTS = {}
for m in CONTROLNET_CONFIGS:
if m.alias:
CONTROLNET_CONFIG_SHORTCUTS[m.alias] = m

for m in CONTROLNET_CONFIGS:
CONTROLNET_CONFIG_SHORTCUTS[m.short_name] = m

SAMPLER_TYPE_OPTIONS = [
"plms",
Expand Down
2 changes: 2 additions & 0 deletions imaginairy/outpaint.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ def prepare_image_for_outpaint(


def outpaint_arg_str_parse(arg_str):
if not arg_str:
return {}
arg_pattern = re.compile(r"([A-Z]+)(\d+)")

args = arg_str.upper().split(",")
Expand Down
Loading

0 comments on commit 7c2004b

Please sign in to comment.