Spaces:
Running
on
Zero
Running
on
Zero
philipp-zettl
commited on
Commit
•
8ee496d
1
Parent(s):
922fdb6
make app reusable for other models
Browse files
app.py
CHANGED
@@ -1,11 +1,12 @@
|
|
1 |
import gradio as gr
|
2 |
import spaces
|
3 |
import torch
|
|
|
4 |
from compel import Compel, ReturnedEmbeddingsType
|
5 |
from diffusers import DiffusionPipeline
|
6 |
|
7 |
|
8 |
-
model_name = 'UnfilteredAI/NSFW-gen-v2'
|
9 |
pipe = DiffusionPipeline.from_pretrained(
|
10 |
model_name,
|
11 |
torch_dtype=torch.float16
|
|
|
1 |
import gradio as gr
|
2 |
import spaces
|
3 |
import torch
|
4 |
+
import os
|
5 |
from compel import Compel, ReturnedEmbeddingsType
|
6 |
from diffusers import DiffusionPipeline
|
7 |
|
8 |
|
9 |
+
model_name = os.environ.get('MODEL_NAME', 'UnfilteredAI/NSFW-gen-v2')
|
10 |
pipe = DiffusionPipeline.from_pretrained(
|
11 |
model_name,
|
12 |
torch_dtype=torch.float16
|