Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import random
|
|
5 |
import spaces #[uncomment to use ZeroGPU]
|
6 |
#from diffusers import DiffusionPipeline ,AutoencoderTiny
|
7 |
import torch
|
8 |
-
|
9 |
from huggingface_hub import login
|
10 |
import os
|
11 |
a=os.getenv('hf_key')
|
@@ -31,7 +31,33 @@ MAX_SEED = np.iinfo(np.int32).max
|
|
31 |
MAX_IMAGE_SIZE = 1024
|
32 |
|
33 |
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
pipe = StableDiffusionPipeline.from_pretrained(
|
37 |
"nota-ai/bk-sdm-small", torch_dtype=torch_dtype, use_safetensors=True)
|
@@ -58,7 +84,7 @@ def infer(
|
|
58 |
|
59 |
image = pipe(
|
60 |
prompt=prompt,
|
61 |
-
negative_prompt=
|
62 |
guidance_scale=guidance_scale,
|
63 |
num_inference_steps=num_inference_steps,
|
64 |
width=width,
|
|
|
5 |
import spaces #[uncomment to use ZeroGPU]
|
6 |
#from diffusers import DiffusionPipeline ,AutoencoderTiny
|
7 |
import torch
|
8 |
+
from diffusers import AutoencoderTiny, StableDiffusionPipeline
|
9 |
from huggingface_hub import login
|
10 |
import os
|
11 |
a=os.getenv('hf_key')
|
|
|
31 |
MAX_IMAGE_SIZE = 1024
|
32 |
|
33 |
|
34 |
+
|
35 |
+
|
36 |
+
negative_prompt1= """score_9, score_8, aidxlv05_neg, bad-artist, FastNegative,
|
37 |
+
worst quality, normal quality, low quality, low res, blurry, distortion, text, watermark,
|
38 |
+
logo, banner, extra digits, cropped, jpeg artifacts, signature, username, error, sketch, duplicate, ugly,
|
39 |
+
monochrome, horror, geometry, mutation, disgusting, bad anatomy, bad proportions, bad quality, deformed,
|
40 |
+
disconnected limbs, out of frame, out of focus, dehydrated, disfigured, extra arms, extra limbs, extra hands,
|
41 |
+
fused fingers, gross proportions, long neck, jpeg, malformed limbs, mutated, mutated hands, mutated limbs,
|
42 |
+
missing arms, missing fingers, picture frame, poorly drawn hands, poorly drawn face, collage, pixel, pixelated,
|
43 |
+
grainy, color aberration, amputee, autograph, bad illustration, beyond the borders, blank background,
|
44 |
+
body out of frame, boring background, branding, cut off, dismembered, disproportioned, distorted, draft,
|
45 |
+
duplicated features, extra fingers, extra legs, fault, flaw, grains, hazy, identifying mark,
|
46 |
+
improper scale, incorrect physiology, incorrect ratio, indistinct, kitsch, low resolution, macabre,
|
47 |
+
malformed, mark, misshapen, missing hands, missing legs, mistake, morbid, mutilated, off-screen,
|
48 |
+
outside the picture, poorly drawn feet, printed words, render, repellent, replicate, reproduce,
|
49 |
+
revolting dimensions, script, shortened, sign, split image, squint, storyboard,
|
50 |
+
tiling, trimmed, unfocused, unattractive, unnatural pose, unreal engine, unsightly, written language"""
|
51 |
+
|
52 |
+
|
53 |
+
|
54 |
+
|
55 |
+
|
56 |
+
|
57 |
+
|
58 |
+
|
59 |
+
|
60 |
+
|
61 |
|
62 |
pipe = StableDiffusionPipeline.from_pretrained(
|
63 |
"nota-ai/bk-sdm-small", torch_dtype=torch_dtype, use_safetensors=True)
|
|
|
84 |
|
85 |
image = pipe(
|
86 |
prompt=prompt,
|
87 |
+
negative_prompt=negative_prompt1,
|
88 |
guidance_scale=guidance_scale,
|
89 |
num_inference_steps=num_inference_steps,
|
90 |
width=width,
|