anzorq commited on
Commit
2c19098
1 Parent(s): 6fc0014

initial commit

Browse files
Files changed (2) hide show
  1. app.py +32 -0
  2. requirements.txt +3 -0
app.py ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from diffusers import StableDiffusionPipeline
2
+ import gradio as gr
3
+
4
+ pipe = StableDiffusionPipeline.from_pretrained("nitrosocke/Arcane-Diffusion")
5
+
6
+ def inference(prompt, guidance, steps):
7
+ all_images = []
8
+ images = pipe([prompt] * 1, num_inference_steps=int(steps), guidance_scale=guidance, width=512, height=512).images
9
+ all_images.extend(images)
10
+ return all_images
11
+
12
+ with gr.Blocks() as demo:
13
+ with gr.Row():
14
+ with gr.Column():
15
+ prompt = gr.Textbox(label="prompt")
16
+ guidance = gr.Slider(label="guidance scale", value=7.5, maximum=15)
17
+ steps = gr.Slider(label="steps", value=50, maximum=100, minimum=2)
18
+ run = gr.Button(value="Run")
19
+ with gr.Column():
20
+ gallery = gr.Gallery(show_label=False)
21
+
22
+ run.click(inference, inputs=[prompt, guidance, steps], outputs=gallery)
23
+ gr.Examples([
24
+ ["jason bateman disassembling the demon core, arcane style", 7.5, 50],
25
+ ["portrait of dwayne johnson, arcane style", 7.0, 75],
26
+ ["portrait of a beautiful alyx vance half life, volume lighting, concept art, by greg rutkowski!!, colorful, xray melting colors!!, arcane style", 7, 50],
27
+ ["Aloy from Horizon: Zero Dawn, half body portrait, videogame cover art, highly detailed, digital painting, artstation, concept art, smooth, detailed armor, sharp focus, beautiful face, illustration, art by Artgerm and greg rutkowski and alphonse mucha, arcane style", 7, 50],
28
+ ["fantasy portrait painting, digital art, arcane style", 4, 30],
29
+ ], [prompt, guidance, steps], gallery, inference, cache_examples=False)
30
+
31
+ demo.queue()
32
+ demo.launch()
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ diffusers
2
+ transformers
3
+ torch