DiffusionArtco commited on
Commit
124b67c
0 Parent(s):

Duplicate from DiffusionArtco/diffusion10

Browse files
Files changed (3) hide show
  1. .gitattributes +34 -0
  2. README.md +13 -0
  3. app.py +37 -0
.gitattributes ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tflite filter=lfs diff=lfs merge=lfs -text
29
+ *.tgz filter=lfs diff=lfs merge=lfs -text
30
+ *.wasm filter=lfs diff=lfs merge=lfs -text
31
+ *.xz filter=lfs diff=lfs merge=lfs -text
32
+ *.zip filter=lfs diff=lfs merge=lfs -text
33
+ *.zst filter=lfs diff=lfs merge=lfs -text
34
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: ImagineAI Imagine Generator
3
+ emoji: 💩
4
+ colorFrom: yellow
5
+ colorTo: pink
6
+ sdk: gradio
7
+ sdk_version: 3.24.1
8
+ app_file: app.py
9
+ pinned: false
10
+ duplicated_from: DiffusionArtco/diffusion10
11
+ ---
12
+
13
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import requests
3
+ from PIL import Image
4
+ from io import BytesIO
5
+ import base64
6
+
7
+ api_url = "https://5cb20b40-572c-426f-9466-995256f9b6eb.id.repl.co/generate_image"
8
+
9
+ def generate_image(model="Deliberate", prompt="", seed=0, negative_prompt="", sampler="k_dpmpp_2s_a", steps=50):
10
+ data = "?model=" + model + "&prompt=" + prompt + "&seed=" + str(seed) + "&negative_prompt=" + negative_prompt + "&sampler=" + sampler + "&steps=" + str(steps)
11
+ response = requests.post(api_url + data, timeout=400)
12
+ if response.status_code == 200:
13
+ img_base64 = response.json()["url"]
14
+ img_bytes = base64.b64decode(img_base64)
15
+ img = Image.open(BytesIO(img_bytes))
16
+ return img
17
+ else:
18
+ return None
19
+
20
+ inputs = [
21
+ gr.inputs.Dropdown(['Abyss OrangeMix', 'Anything Diffusion', 'ChilloutMix', 'Deliberate', 'Dreamshaper', 'Dreamlike Diffusion', 'Dreamlike Photoreal', 'Experience', 'Midjourney Diffusion', 'ProtoGen', 'Realistic Vision', 'Rev Animated'], label="Model", default="Deliberate"),
22
+ gr.inputs.Textbox(label="Prompt"),
23
+ gr.inputs.Number(label="Seed", default=0),
24
+ gr.inputs.Textbox(label="Negative Prompt", default=""),
25
+ gr.inputs.Dropdown(["k_lms", "k_heun", "k_euler", "k_euler_a", "k_dpm_2", "k_dpm_2_a", "DDIM", "k_dpm_fast", "k_dpm_adaptive", "k_dpmpp_2m", "k_dpmpp_2s_a", "k_dpmpp_sde"], label="Sampler", default="k_dpmpp_2s_a"),
26
+ gr.inputs.Number(label="Steps", default=50)
27
+ ]
28
+
29
+ outputs = gr.outputs.Image(label="Generated Image", type="pil")
30
+
31
+ interface = gr.Interface(generate_image, inputs, outputs, title="Best Diffusion Models",
32
+ description="<center>Live access to the Most Popular Diffusion models of all time</center>",
33
+ examples=[])
34
+
35
+ interface.launch()
36
+
37
+