panelforge
commited on
Commit
•
82411a8
1
Parent(s):
33dada6
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
import random
|
4 |
-
|
5 |
from diffusers import DiffusionPipeline
|
6 |
import torch
|
7 |
|
8 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
9 |
-
model_repo_id = "
|
10 |
|
11 |
if torch.cuda.is_available():
|
12 |
torch_dtype = torch.float16
|
@@ -19,7 +19,7 @@ pipe = pipe.to(device)
|
|
19 |
MAX_SEED = np.iinfo(np.int32).max
|
20 |
MAX_IMAGE_SIZE = 1024
|
21 |
|
22 |
-
|
23 |
def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps, progress=gr.Progress(track_tqdm=True)):
|
24 |
|
25 |
if randomize_seed:
|
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
import random
|
4 |
+
import spaces #[uncomment to use ZeroGPU]
|
5 |
from diffusers import DiffusionPipeline
|
6 |
import torch
|
7 |
|
8 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
9 |
+
model_repo_id = "John6666/wai-ani-nsfw-ponyxl-v7-sdxl" #Replace to the model you would like to use
|
10 |
|
11 |
if torch.cuda.is_available():
|
12 |
torch_dtype = torch.float16
|
|
|
19 |
MAX_SEED = np.iinfo(np.int32).max
|
20 |
MAX_IMAGE_SIZE = 1024
|
21 |
|
22 |
+
@spaces.GPU #[uncomment to use ZeroGPU]
|
23 |
def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps, progress=gr.Progress(track_tqdm=True)):
|
24 |
|
25 |
if randomize_seed:
|