Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -147,7 +147,7 @@ models = {key: load_and_prepare_model(value) for key, value in MODEL_OPTIONS.ite
|
|
147 |
|
148 |
MAX_SEED = np.iinfo(np.int32).max
|
149 |
|
150 |
-
neg_prompt_2 = " 'unrealistic skin','unattractive face':1.3, 'low quality':1.1, ('dull color scheme', 'dull colors', 'digital noise':1.2),'amateurish', 'poorly drawn face':1.3, 'poorly drawn', 'distorted face' "
|
151 |
|
152 |
def upload_to_ftp(filename):
|
153 |
try:
|
@@ -193,11 +193,11 @@ def generate_30(
|
|
193 |
pipe = models[model_choice]
|
194 |
seed = int(randomize_seed_fn(seed, randomize_seed))
|
195 |
generator = torch.Generator(device='cuda').manual_seed(seed)
|
196 |
-
prompt, negative_prompt = apply_style(style_selection, prompt, negative_prompt)
|
197 |
options = {
|
198 |
"prompt": [prompt] * num_images,
|
199 |
-
"negative_prompt": [negative_prompt]
|
200 |
-
"negative_prompt_2": [neg_prompt_2]
|
201 |
"width": width,
|
202 |
"height": height,
|
203 |
"guidance_scale": guidance_scale,
|
@@ -222,8 +222,8 @@ def generate_30(
|
|
222 |
f.write(f"Use Safetensors: no \n")
|
223 |
f.write(f"Use Model Dtype: no \n")
|
224 |
f.write(f"Model Scheduler: Euler_a custom before cuda \n")
|
225 |
-
f.write(f"Model VAE: stabilityai/sdxl-vae before cuda to bfloat
|
226 |
-
f.write(f"Model UNET: stabilityai before cuda to bfloat
|
227 |
upload_to_ftp(filename)
|
228 |
for i in range(0, num_images, BATCH_SIZE):
|
229 |
batch_options = options.copy()
|
@@ -260,10 +260,11 @@ def generate_60(
|
|
260 |
pipe = models[model_choice]
|
261 |
seed = int(randomize_seed_fn(seed, randomize_seed))
|
262 |
generator = torch.Generator(device='cuda').manual_seed(seed)
|
263 |
-
prompt, negative_prompt = apply_style(style_selection, prompt, negative_prompt)
|
264 |
options = {
|
265 |
"prompt": [prompt] * num_images,
|
266 |
-
"negative_prompt": [negative_prompt]
|
|
|
267 |
"width": width,
|
268 |
"height": height,
|
269 |
"guidance_scale": guidance_scale,
|
@@ -288,8 +289,8 @@ def generate_60(
|
|
288 |
f.write(f"Use Safetensors: no \n")
|
289 |
f.write(f"Use Model Dtype: no \n")
|
290 |
f.write(f"Model Scheduler: Euler_a custom before cuda \n")
|
291 |
-
f.write(f"Model VAE: stabilityai/sdxl-vae before cuda to bfloat
|
292 |
-
f.write(f"Model UNET: stabilityai before cuda to bfloat
|
293 |
upload_to_ftp(filename)
|
294 |
for i in range(0, num_images, BATCH_SIZE):
|
295 |
batch_options = options.copy()
|
@@ -326,10 +327,11 @@ def generate_90(
|
|
326 |
pipe = models[model_choice]
|
327 |
seed = int(randomize_seed_fn(seed, randomize_seed))
|
328 |
generator = torch.Generator(device='cuda').manual_seed(seed)
|
329 |
-
prompt, negative_prompt = apply_style(style_selection, prompt, negative_prompt)
|
330 |
options = {
|
331 |
"prompt": [prompt] * num_images,
|
332 |
-
"negative_prompt": [negative_prompt]
|
|
|
333 |
"width": width,
|
334 |
"height": height,
|
335 |
"guidance_scale": guidance_scale,
|
@@ -354,8 +356,8 @@ def generate_90(
|
|
354 |
f.write(f"Use Safetensors: no \n")
|
355 |
f.write(f"Use Model Dtype: no \n")
|
356 |
f.write(f"Model Scheduler: Euler_a custom before cuda \n")
|
357 |
-
f.write(f"Model VAE: stabilityai/sdxl-vae before cuda to bfloat
|
358 |
-
f.write(f"Model UNET: stabilityai before cuda to bfloat
|
359 |
upload_to_ftp(filename)
|
360 |
for i in range(0, num_images, BATCH_SIZE):
|
361 |
batch_options = options.copy()
|
|
|
147 |
|
148 |
MAX_SEED = np.iinfo(np.int32).max
|
149 |
|
150 |
+
neg_prompt_2 = " 'unrealistic skin','unattractive face':1.3, 'low quality':1.1, ('dull color scheme', 'dull colors', 'digital noise':1.2),'amateurish', 'poorly drawn face':1.3, 'poorly drawn', 'distorted face', 'low resolution', 'simplistic' "
|
151 |
|
152 |
def upload_to_ftp(filename):
|
153 |
try:
|
|
|
193 |
pipe = models[model_choice]
|
194 |
seed = int(randomize_seed_fn(seed, randomize_seed))
|
195 |
generator = torch.Generator(device='cuda').manual_seed(seed)
|
196 |
+
#prompt, negative_prompt = apply_style(style_selection, prompt, negative_prompt)
|
197 |
options = {
|
198 |
"prompt": [prompt] * num_images,
|
199 |
+
"negative_prompt": [negative_prompt],
|
200 |
+
"negative_prompt_2": [neg_prompt_2],
|
201 |
"width": width,
|
202 |
"height": height,
|
203 |
"guidance_scale": guidance_scale,
|
|
|
222 |
f.write(f"Use Safetensors: no \n")
|
223 |
f.write(f"Use Model Dtype: no \n")
|
224 |
f.write(f"Model Scheduler: Euler_a custom before cuda \n")
|
225 |
+
f.write(f"Model VAE: stabilityai/sdxl-vae before cuda to bfloat with pipe \n")
|
226 |
+
f.write(f"Model UNET: stabilityai before cuda to bfloat with pipe \n")
|
227 |
upload_to_ftp(filename)
|
228 |
for i in range(0, num_images, BATCH_SIZE):
|
229 |
batch_options = options.copy()
|
|
|
260 |
pipe = models[model_choice]
|
261 |
seed = int(randomize_seed_fn(seed, randomize_seed))
|
262 |
generator = torch.Generator(device='cuda').manual_seed(seed)
|
263 |
+
#prompt, negative_prompt = apply_style(style_selection, prompt, negative_prompt)
|
264 |
options = {
|
265 |
"prompt": [prompt] * num_images,
|
266 |
+
"negative_prompt": [negative_prompt],
|
267 |
+
"negative_prompt_2": [neg_prompt_2],
|
268 |
"width": width,
|
269 |
"height": height,
|
270 |
"guidance_scale": guidance_scale,
|
|
|
289 |
f.write(f"Use Safetensors: no \n")
|
290 |
f.write(f"Use Model Dtype: no \n")
|
291 |
f.write(f"Model Scheduler: Euler_a custom before cuda \n")
|
292 |
+
f.write(f"Model VAE: stabilityai/sdxl-vae before cuda to bfloat with pipe \n")
|
293 |
+
f.write(f"Model UNET: stabilityai before cuda to bfloat with pipe \n")
|
294 |
upload_to_ftp(filename)
|
295 |
for i in range(0, num_images, BATCH_SIZE):
|
296 |
batch_options = options.copy()
|
|
|
327 |
pipe = models[model_choice]
|
328 |
seed = int(randomize_seed_fn(seed, randomize_seed))
|
329 |
generator = torch.Generator(device='cuda').manual_seed(seed)
|
330 |
+
#prompt, negative_prompt = apply_style(style_selection, prompt, negative_prompt)
|
331 |
options = {
|
332 |
"prompt": [prompt] * num_images,
|
333 |
+
"negative_prompt": [negative_prompt],
|
334 |
+
"negative_prompt_2": [neg_prompt_2],
|
335 |
"width": width,
|
336 |
"height": height,
|
337 |
"guidance_scale": guidance_scale,
|
|
|
356 |
f.write(f"Use Safetensors: no \n")
|
357 |
f.write(f"Use Model Dtype: no \n")
|
358 |
f.write(f"Model Scheduler: Euler_a custom before cuda \n")
|
359 |
+
f.write(f"Model VAE: stabilityai/sdxl-vae before cuda to bfloat with pipe \n")
|
360 |
+
f.write(f"Model UNET: stabilityai before cuda to bfloat with pipe \n")
|
361 |
upload_to_ftp(filename)
|
362 |
for i in range(0, num_images, BATCH_SIZE):
|
363 |
batch_options = options.copy()
|