1
0
Fork 0

switch upscaling to np random

This commit is contained in:
Sean Sube 2023-11-26 15:29:07 -06:00
parent d3a4cc8fd2
commit a9b4303d25
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,7 @@ from logging import getLogger
from os import path from os import path
from typing import Optional from typing import Optional
import torch import numpy as np
from PIL import Image from PIL import Image
from ..diffusers.load import load_pipeline from ..diffusers.load import load_pipeline
@ -47,7 +47,7 @@ class UpscaleStableDiffusionStage(BaseStage):
worker.get_device(), worker.get_device(),
model=path.join(server.model_path, upscale.upscale_model), model=path.join(server.model_path, upscale.upscale_model),
) )
generator = torch.manual_seed(params.seed) rng = np.random.RandomState(params.seed)
if not params.is_xl(): if not params.is_xl():
prompt_embeds = encode_prompt( prompt_embeds = encode_prompt(
@ -63,7 +63,7 @@ class UpscaleStableDiffusionStage(BaseStage):
result = pipeline( result = pipeline(
prompt, prompt,
source, source,
generator=generator, generator=rng,
guidance_scale=params.cfg, guidance_scale=params.cfg,
negative_prompt=negative_prompt, negative_prompt=negative_prompt,
num_inference_steps=params.steps, num_inference_steps=params.steps,