Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions optimizedSD/img2img_gradio.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from PIL import Image
import torch
import numpy as np
from random import randint
from omegaconf import OmegaConf
from PIL import Image
from tqdm import tqdm, trange
Expand Down Expand Up @@ -115,7 +114,7 @@ def generate(
):

if seed == "":
seed = randint(0, 1000000)
seed = np.random.randint(np.iinfo(np.uint32).max, dtype='uint32')
seed = int(seed)
seed_everything(seed)

Expand Down
3 changes: 1 addition & 2 deletions optimizedSD/inpaint_gradio.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import time
from contextlib import nullcontext
from itertools import islice
from random import randint

import gradio as gr
import numpy as np
Expand Down Expand Up @@ -103,7 +102,7 @@ def generate(
full_precision,
):
if seed == "":
seed = randint(0, 1000000)
seed = np.random.randint(np.iinfo(np.uint32).max, dtype='uint32')
seed = int(seed)
seed_everything(seed)
sampler = "ddim"
Expand Down
3 changes: 1 addition & 2 deletions optimizedSD/optimized_img2img.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import argparse, os, re
import torch
import numpy as np
from random import randint
from omegaconf import OmegaConf
from PIL import Image
from tqdm import tqdm, trange
Expand Down Expand Up @@ -182,7 +181,7 @@ def load_img(path, h0, w0):
grid_count = len(os.listdir(outpath)) - 1

if opt.seed == None:
opt.seed = randint(0, 1000000)
opt.seed = np.random.randint(np.iinfo(np.uint32).max, dtype='uint32')
seed_everything(opt.seed)

# Logging
Expand Down
3 changes: 1 addition & 2 deletions optimizedSD/optimized_txt2img.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import argparse, os, re
import torch
import numpy as np
from random import randint
from omegaconf import OmegaConf
from PIL import Image
from tqdm import tqdm, trange
Expand Down Expand Up @@ -175,7 +174,7 @@ def load_model_from_config(ckpt, verbose=False):
grid_count = len(os.listdir(outpath)) - 1

if opt.seed == None:
opt.seed = randint(0, 1000000)
opt.seed = np.random.randint(np.iinfo(np.uint32).max, dtype='uint32')
seed_everything(opt.seed)

# Logging
Expand Down
3 changes: 1 addition & 2 deletions optimizedSD/txt2img_gradio.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import torch
import pandas as pd
import numpy as np
from random import randint
from omegaconf import OmegaConf
from PIL import Image
from tqdm import tqdm, trange
Expand Down Expand Up @@ -105,7 +104,7 @@ def generate(
modelCS.cond_stage_model.device = device

if seed == "":
seed = randint(0, 1000000)
seed = np.random.randint(np.iinfo(np.uint32).max, dtype='uint32')
seed = int(seed)
seed_everything(seed)
# Logging
Expand Down