Skip to content

Commit

Permalink
tweak dreaming
Browse files Browse the repository at this point in the history
  • Loading branch information
aayars committed Aug 9, 2023
1 parent 5392924 commit f1b420e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
10 changes: 5 additions & 5 deletions noisemaker/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def describe(preset_name, prompt, filename):
return summary


def dream(nightmare=False):
def dream():
api_key = None
api_key_path = util.get_noisemaker_dir() + "/.creds/.openai"
if os.path.exists(api_key_path):
Expand All @@ -182,10 +182,10 @@ def dream(nightmare=False):
if api_key is None:
raise Exception(f"Missing OpenAI API key at {api_key_path}.")

if nightmare:
flavor_text = "a dark and powerful omen portending a prophetic event, perhaps apocalyptic in nature. To know the thing is to know madness."
else:
flavor_text = "as if it were something from a vision or dream."
#
#
#
flavor_text = f"as if it were something from a vision or dream."

system_prompt = f"Imagine a system that generates images from a text prompt, and come up with a prompt from the deepest reaches of your synthetic imagination, {flavor_text} The image must not include humanoid forms. Do not label the answers with anything like \"Name\" or \"Description\". The description may not exceed 250 characters."

Expand Down
9 changes: 4 additions & 5 deletions noisemaker/scripts/noisemaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,22 +395,21 @@ def _use_reasonable_speed(preset, frame_count):
@cli.width_option()
@cli.height_option()
@cli.seed_option()
@click.option('--nightmare', help="This isn't fun anymore", is_flag=True, default=False)
@cli.filename_option(default='dream.png')
def dream(width, height, seed, nightmare, filename):
def dream(width, height, seed, filename):
if seed is None:
seed = random.randint(1, MAX_SEED_VALUE)

name, prompt = ai.dream(nightmare)
name, prompt = ai.dream()

shape = [height, width, 3]

color_space = random_member([ColorSpace.hsv, ColorSpace.rgb, ColorSpace.oklab])

tensor = generators.basic(freq=[int(height * .25) or 1, int(width * .25) or 1], shape=shape, color_space=ColorSpace.oklab, hue_range=0.5 + random.random())
tensor = generators.basic(freq=[height, width], shape=shape, color_space=color_space, hue_range=0.5 + random.random())

settings = {
"image_strength": 0.025,
"image_strength": 0.05,
"cfg_scale": 35,
"prompt": prompt,
"style_preset": "photographic",
Expand Down

0 comments on commit f1b420e

Please sign in to comment.