Spaces:
Running
on
Zero
Running
on
Zero
alfredplpl
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -39,14 +39,12 @@ MAX_IMAGE_SIZE = 2048
|
|
39 |
@spaces.GPU
|
40 |
def infer(seed, randomize_seed, width, height, guidance_scale, num_inference_steps):
|
41 |
prompt = "<|bos|><rating>rating:sfw, rating:general</rating><copyright>original</copyright><character></character><general><|long|>1girl<|input_end|>"
|
42 |
-
inputs = tokenizer(prompt, return_tensors="pt").input_ids
|
43 |
|
44 |
with torch.no_grad():
|
45 |
outputs = model.generate(inputs, generation_config=model.generation_config)
|
46 |
|
47 |
prompt=tokenizer.decode(outputs[0], skip_special_tokens=True).split("rating:general,")[1]
|
48 |
-
# rating:sfw, rating:general, 1girl, ahoge, braid, closed eyes, collared dress, dress, flower, full body, hair flower, hair ornament, long hair, night, night sky, outdoors, parted lips, pink flower, pink hair, short sleeves, sky, solo, straight hair, sunflower, very long hair, white flower
|
49 |
-
|
50 |
negative_prompt="unaestheticXLv31"
|
51 |
|
52 |
if randomize_seed:
|
|
|
39 |
@spaces.GPU
|
40 |
def infer(seed, randomize_seed, width, height, guidance_scale, num_inference_steps):
|
41 |
prompt = "<|bos|><rating>rating:sfw, rating:general</rating><copyright>original</copyright><character></character><general><|long|>1girl<|input_end|>"
|
42 |
+
inputs = tokenizer(prompt, return_tensors="pt").input_ids.to(device)
|
43 |
|
44 |
with torch.no_grad():
|
45 |
outputs = model.generate(inputs, generation_config=model.generation_config)
|
46 |
|
47 |
prompt=tokenizer.decode(outputs[0], skip_special_tokens=True).split("rating:general,")[1]
|
|
|
|
|
48 |
negative_prompt="unaestheticXLv31"
|
49 |
|
50 |
if randomize_seed:
|