diff --git a/src/bots/eden/prompts/creator_prompt.txt b/src/bots/eden/prompts/creator_prompt.txt index ff8edcb..624c295 100644 --- a/src/bots/eden/prompts/creator_prompt.txt +++ b/src/bots/eden/prompts/creator_prompt.txt @@ -17,10 +17,14 @@ The full schema of a config is as follows. Not all fields are relevant to all ge Config schema: * "generator" is which generator to use. * "text_input" is the text prompt which describes the desired image. It should start with a subject and details, followed by a list of modifier keywords which describe the desired style or aesthetic of the image. Make sure the prompt accurately conveys the user's intent, and is evocative and detailed enough to make a good image, but you may be creative to enhance the user's request into a good text_input. VERY IMPORTANT: if the user asks you to make an image including or of yourself, you should include YOUR NAME in the text_input. (create, controlnet) -* "init_image_data" is a path to an image file which is used as an input or control image for a generator that operates on input images (remix, controlnet, upscale) +* "seed" is a random seed to use for single image generation. Using the same seed for the same config reproduces the exact same generation. If you want to reproduce or slightly alter an earlier creation, copy the seed of the earlier creation. Otherwise leave this blank. (create, controlnet, remix, blend, upscale) +* "init_image" is a path to an image file which is used as an input or control image for a generator that operates on input images (remix, controlnet, upscale) * "interpolation_init_images" is a *list* of image paths to generate a real2real interpolation video OR a blended image. Image paths must be provided. Copy them from the user. (real2real, blend) * "interpolation_texts" is a list of text prompts to generate an interpolation video. You must interpret the user's description of the imagery into a *list* with at least two elements. Be creative. VERY IMPORTANT: if the user asks you to make a video including or of yourself, you should include YOUR NAME in all the interpolation_texts. (interpolate) +* "interpolation_seeds" is a list of random numbers, of the same length as "interpolation_texts". If you need to reproduce an earlier interpolation, copy its interpolation_seeds. Otherwise leave this blank. (interpolate, real2real) * "n_frames" is the number of frames (at 12fps) in the output video. If the user doesn't mention a duration or explicit number of frames, default to 60 if a video (interpolate, real2real) * "concept" is an optional reference to a specific finetuned concept. Only the following concepts are available: Banny, Kojii, LittleMartian. If the user specifically invokes one of these concepts, select it for the "concept" field and try to include it in the "text_input" field. Note the user might spell it differently, but you should use this spelling not theirs. If no concept is referenced, leave it blank. (create) -When prompted, please output the config and a helpful message explaining what you did to make it and alerting the user to wait for the creation to be made. If the config requires files (such as for the init_image_data or interpolation_init_images fields), make sure to use only the files that were provided by the user in the attachments field. \ No newline at end of file +Note that sometimes the user will make reference to a prior creation, asking you to either modify it or include it in something new. By copying the seed of the prior creation (or in case of video, interpolation_seeds), you can reproduce it with the same config. If you want to make small changes to the prior creation, copy its seed and make changes to the prompt or other parameters. + +When prompted, please output the config and a message, in character, explaining what you did to make it and alerting the user to wait for the creation to be made. If the config requires files (such as for the init_image or interpolation_init_images fields), make sure to use only the files that were provided by the user in the attachments field. \ No newline at end of file diff --git a/src/cogs/AssistantCog.py b/src/cogs/AssistantCog.py index 50c770c..83cddfb 100644 --- a/src/cogs/AssistantCog.py +++ b/src/cogs/AssistantCog.py @@ -75,39 +75,41 @@ async def on_message(self, message: discord.Message) -> None: } response = self.assistant( - assistant_message, session_id=str(message.author.id) + assistant_message, + session_id=str(message.author.id) ) - print("rrrrr", response) - - reply = response["message"][:2000] + reply = response.get("message")[:2000] reply_message = await message.reply(reply) # check if there is a config - config = response["config"] + config = response.get("config") + if not config: return mode = config.pop("generator") - if "text_input" in config: + if config.get("text_input"): text_input = config["text_input"] - elif "interpolation_texts" in config: + elif config.get("interpolation_texts"): text_input = " to ".join(config["interpolation_texts"]) else: text_input = mode - if "init_image_data" in config: - config["init_image_data"] = attachment_lookup_url.get( - config["init_image_data"] + if config.get("init_image"): + config["init_image"] = attachment_lookup_url.get( + config["init_image"] ) - if "interpolation_init_images" in config: + if config.get("interpolation_init_images"): config["interpolation_init_images"] = [ attachment_lookup_url.get(img) for img in config["interpolation_init_images"] ] - + if not config.get("seed"): + config["seed"] = random.randint(1, 1e8) + config = StableDiffusionConfig( - generator_name=mode, seed=random.randint(1, 1e8), **config + generator_name=mode, **config ) source = get_source(ctx) diff --git a/src/common/eden.py b/src/common/eden.py index 686eafe..69b83f3 100644 --- a/src/common/eden.py +++ b/src/common/eden.py @@ -24,7 +24,6 @@ async def request_creation( } attributes = await build_eden_task_attributes(api_url, source.author_id) - print("attributes", attributes) request = { "generatorName": generator_name, @@ -35,9 +34,6 @@ async def request_creation( # response = requests.post(f"{api_url}/tasks/create", json=request, headers=header) response = requests.post(f"{api_url}/admin/tasks/create", json=request, headers=header) - print("config") - print(config_dict) - check, error = await check_server_result_ok(response) if not check: