From ba5da461e1828ff7554691eaf318e1093ffa6d41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20M=C3=BCller?= Date: Fri, 8 Mar 2024 11:54:09 +0100 Subject: [PATCH] cleanup runner.py --- tti-provider/runner.py | 37 +++++++------------------------------ 1 file changed, 7 insertions(+), 30 deletions(-) diff --git a/tti-provider/runner.py b/tti-provider/runner.py index 0c953e0..b83e372 100644 --- a/tti-provider/runner.py +++ b/tti-provider/runner.py @@ -69,17 +69,14 @@ try: image = Image.new('RGB', size, color='white') """ - """ - # Current working... - pipe = DiffusionPipeline.from_pretrained("stablediffusionapi/juggernaut-xl-v8") - pipe.to("cpu") + # Resulution Widescreen: 1344 x 768 + # Portrait: 915 x 1144 + # Square: 1024 x 1024 + # Photo (4x3): 1182 x 886 - image = pipe( - prompt=prompt, - # generator=torch.Generator(device="cpu").manual_seed(31), - negative_prompt=neg_prompt, - ).images[0] - """ + # Prompt weighting + # prompt = "a red cat playing with a ball++" + # prompt = "a red------- cat playing with a ball" base = DiffusionPipeline.from_pretrained( "stablediffusionapi/juggernaut-xl-v8" @@ -108,26 +105,6 @@ try: ).images[0] image - # Resulution Widescreen: 1344 x 768 - # Portrait: 915 x 1144 - # Square: 1024 x 1024 - # Photo (4x3): 1182 x 886 - - """ - pipe = StableDiffusionXLPipeline.from_pretrained( - "stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16 - ) - - pipe = pipe.to("cpu") - - prompt = "a photo of an astronaut riding a horse on mars" - - image = pipe(prompt).images[0] - # prompt = "A cinematic shot of a baby racoon wearing an intricate italian priest robe." - - # image = pipe(prompt=row['initial_prompt'], num_inference_steps=1, guidance_scale=0.0).images[0] - """ - img_uuid = str(uuid.uuid4()) file_name = '/app/images/' + img_uuid + '.png' # logging.debug(file_name)