JoPmt commited on
Commit
88c6e7a
1 Parent(s): 9baea17

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +69 -0
app.py ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from diffusers import AutoPipelineForText2Image
2
+ import torch
3
+ import gradio as gr
4
+ from PIL import Image
5
+ import os
6
+ from diffusers.utils import load_image
7
+ from accelerate import Accelerator
8
+
9
+ accelerator = Accelerator()
10
+ models =[
11
+ "stablediffusionapi/disney-pixal-cartoon",
12
+ "stablediffusionapi/edge-of-realism",
13
+ "sd-dreambooth-library/original-character-cyclps",
14
+ "AIArtsChannel/steampunk-diffusion",
15
+ "nitrosocke/mo-di-diffusion",
16
+ "MirageML/fantasy-scene",
17
+ "wavymulder/lomo-diffusion",
18
+ "sd-dreambooth-library/fashion",
19
+ "DucHaiten/DucHaitenDreamWorld",
20
+ "VegaKH/Ultraskin",
21
+ "kandinsky-community/kandinsky-2-1",
22
+ "plasmo/woolitize-768sd1-5",
23
+ "plasmo/food-crit",
24
+ "johnslegers/epic-diffusion-v1.1",
25
+ "robotjung/SemiRealMix",
26
+ "prompthero/linkedin-diffusion",
27
+ "RayHell/popupBook-diffusion",
28
+ "MirageML/lowpoly-world",
29
+ "warp-ai/wuerstchen",
30
+ "deadman44/SD_Photoreal_Merged_Models",
31
+ "johnslegers/epic-diffusion",
32
+ "wavymulder/modelshoot",
33
+ "Fictiverse/Stable_Diffusion_VoxelArt_Model",
34
+ "nousr/robo-diffusion-2-base",
35
+ "darkstorm2150/Protogen_v2.2_Official_Release",
36
+ "hassanblend/HassanBlend1.5.1.2",
37
+ "hassanblend/hassanblend1.4",
38
+ "nitrosocke/redshift-diffusion",
39
+ "prompthero/openjourney-v2",
40
+ "nitrosocke/Arcane-Diffusion",
41
+ "Lykon/DreamShaper",
42
+ "wavymulder/Analog-Diffusion",
43
+ "dreamlike-art/dreamlike-diffusion-1.0",
44
+ "dreamlike-art/dreamlike-photoreal-2.0",
45
+ "digiplay/RealismEngine_v1",
46
+ "digiplay/AIGEN_v1.4_diffusers",
47
+ "stablediffusionapi/dreamshaper-v6",
48
+ "axolotron/ice-cream-animals",
49
+ "FFusion/FFXL400",
50
+ "TheLastBen/froggy-style-v21-768",
51
+ "FloydianSound/Nixeu_Diffusion_v1-5",
52
+ "digiplay/PotoPhotoRealism_v1",
53
+ ]
54
+
55
+ def plex(prompt,goof,modil):
56
+ pipe = accelerator.prepare(AutoPipelineForText2Image.from_pretrained(modil, torch_dtype=torch.float32))
57
+ pipe = accelerator.prepare(pipe.to("cpu"))
58
+ # prompt = "A fantasy landscape, Cinematic lighting"
59
+ # negative_prompt = "low quality, bad quality"
60
+
61
+ #rmage = load_image(goof)
62
+ #original_image = rmage.convert("RGB")
63
+ #original_image.thumbnail((512, 512))
64
+
65
+ image = pipe(prompt=prompt, num_inference_steps=30).images[0]
66
+ return image
67
+
68
+ iface = gr.Interface(fn=plex,inputs=[gr.Textbox(label="Prompt"), gr.Dropdown(choices=models,label="Model")],outputs=gr.Image(),title="AutoPipelineForText2Image_SD_Multi",description="AutoPipelineForText2Image_SD_Multi")
69
+ iface.launch()