Spaces:
Thafx
/
Runtime error

Thafx commited on
Commit
99f2810
·
1 Parent(s): 0fb21d3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -33
app.py CHANGED
@@ -3,15 +3,15 @@ import gradio as gr
3
  import torch
4
  from PIL import Image
5
 
6
- model_id = 'Dunkindont/Foto-Assisted-Diffusion-FAD_V0'
7
- prefix = ''
8
-
9
- scheduler = DPMSolverMultistepScheduler.from_pretrained(model_id, subfolder="FAD768-Diffuser Model/scheduler")
10
 
11
  pipe = StableDiffusionPipeline.from_pretrained(
12
  model_id,
13
  torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
14
- scheduler=scheduler)
15
 
16
  pipe_i2i = StableDiffusionImg2ImgPipeline.from_pretrained(
17
  model_id,
@@ -51,7 +51,7 @@ def _parse_args(prompt, generator):
51
  ), f"Config override '{var_val}' does not have the form 'VAR=val'"
52
  conf_args.add_opt(opt, var_val[0], var_val[1], force_override=True)
53
 
54
- def inference(prompt, guidance, steps, width=768, height=768, seed=0, img=None, strength=0.5, neg_prompt="", auto_prefix=False):
55
  generator = torch.Generator('cuda').manual_seed(seed) if seed != 0 else None
56
  prompt = f"{prefix} {prompt}" if auto_prefix else prompt
57
 
@@ -107,37 +107,33 @@ with gr.Blocks(css=css) as demo:
107
  f"""
108
  <div class="main-div">
109
  <div>
110
- <h1 style="color:purple; font-family: verdana;">Foto Assisted Diffusion (FAD) </h1>
111
  </div>
112
  <p>
113
- Demo for <a href="https://huggingface.co/Dunkindont"><abbr title="Foto Assisted Diffusion">(FAD)</abbr></a>
114
- Stable Diffusion model by <a href="https://huggingface.co/Dunkindont"><abbr title="Dunkindont">Dunkindont</abbr></a>. {"" if prefix else ""}
115
- Running on {"<b>GPU 🔥</b>" if torch.cuda.is_available() else f"<b>CPU 🔥</b>"}. </p>
 
 
 
116
 
117
- <blockquote>
118
- • Model is meant to mimic a modern HDR photography style.
119
- • Trained on 600 HDR images on SD1.5
120
- • Merged with one of my own models for illustrations and drawings for miniscule uses outside of photography
121
- • No hi-res fix required, can generate natively from supported resolutions (See Supported Resolutions Tab)
122
- </blockquote>
123
- Please use this prompt template below to get an example of the desired generation results:
124
- <br>
125
- <q><em>Important note: You can use the model at 512x512 but the results will likely be undesirable.</em></q>
126
- <br>
127
  <b>Prompt</b>:
128
- <small><code>
129
- medium portrait (close up:0.5) of a Beautiful scottish ginger woman, (messy bun), sitting on a wooden chair, wearing a fancy Victorian era dress, seductively posing, pale skin, dark red lips, dark eye shadow, ornate pendant, sitting in front of a large stone fireplace, candle burning, in a luxurious fantasy castle, side lighting, cinematic, Renaissance style, (Fujifilm XT3:1.1), (high detailed face:1.3), perfect hands
130
- </code></small>
131
-
132
- <b>Negative Prompt</b>:
133
- <code>
134
- Negative prompt: (deformed mouth), (deformed lips), (deformed eyes), (cross-eyed), (deformed iris), (deformed hands), lowers, 3d render, cartoon, long body, wide hips, narrow waist, disfigured, ugly, cross eyed, squinting, grain, Deformed, blurry, bad anatomy, poorly drawn face, mutation, mutated, extra limb, ugly, (poorly drawn hands), missing limb, floating limbs, disconnected limbs, malformed hands, blur, out of focus, long neck, disgusting, poorly drawn, mutilated, , mangled, old, surreal, ((text))
135
- </code>
136
  <br>
 
 
 
 
 
 
 
 
 
137
  <br>
138
- Have Fun & Enjoy <a href="https://www.thafx.com"><abbr title="//THAFX">Website</abbr></a>
139
  <br>
140
-
141
  </div>
142
  """
143
  )
@@ -146,7 +142,7 @@ Have Fun & Enjoy <a href="https://www.thafx.com"><abbr title="//THAFX">Website</
146
  with gr.Column(scale=55):
147
  with gr.Group():
148
  with gr.Row():
149
- prompt = gr.Textbox(label="Positive Prompt", show_label=False, max_lines=2, placeholder=f"{prefix} [your prompt]").style(container=False)
150
  generate = gr.Button(value="Generate").style(rounded=(False, True, True, False))
151
 
152
  image_out = gr.Image(height=512)
@@ -156,7 +152,7 @@ Have Fun & Enjoy <a href="https://www.thafx.com"><abbr title="//THAFX">Website</
156
  with gr.Tab("Options"):
157
  with gr.Group():
158
  neg_prompt = gr.Textbox(label="Negative prompt", placeholder="What to exclude from the image")
159
- auto_prefix = gr.Checkbox(label="Prefix styling tokens automatically (RAW photo,)", value=prefix, visible=prefix)
160
 
161
  with gr.Row():
162
  guidance = gr.Slider(label="Guidance scale", value=7.5, maximum=15)
@@ -183,4 +179,4 @@ Have Fun & Enjoy <a href="https://www.thafx.com"><abbr title="//THAFX">Website</
183
 
184
 
185
  demo.queue(concurrency_count=1)
186
- demo.launch()
 
3
  import torch
4
  from PIL import Image
5
 
6
+ model_id = 'wavymulder/portraitplus'
7
+ prefix = 'portrait+ style,'
8
+
9
+ scheduler = DPMSolverMultistepScheduler.from_pretrained(model_id, subfolder="scheduler")
10
 
11
  pipe = StableDiffusionPipeline.from_pretrained(
12
  model_id,
13
  torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
14
+ scheduler=scheduler)
15
 
16
  pipe_i2i = StableDiffusionImg2ImgPipeline.from_pretrained(
17
  model_id,
 
51
  ), f"Config override '{var_val}' does not have the form 'VAR=val'"
52
  conf_args.add_opt(opt, var_val[0], var_val[1], force_override=True)
53
 
54
+ def inference(prompt, guidance, steps, width=512, height=512, seed=0, img=None, strength=0.5, neg_prompt="", auto_prefix=False):
55
  generator = torch.Generator('cuda').manual_seed(seed) if seed != 0 else None
56
  prompt = f"{prefix} {prompt}" if auto_prefix else prompt
57
 
 
107
  f"""
108
  <div class="main-div">
109
  <div>
110
+ <h1 style="color:yellow;">📸 Portrait Plus 📸</h1>
111
  </div>
112
  <p>
113
+ Demo for <a href="https://huggingface.com/wavymulder/portraitplus">Open Journey V4</a>
114
+ Stable Diffusion model by <a href="https://huggingface.co/wavymulder/"><abbr title="Wavymulder">Wavymulder</abbr></a>. {"" if prefix else ""}
115
+ Running on {"<b>GPU 🔥</b>" if torch.cuda.is_available() else f"<b>CPU ⚡</b>"}.
116
+ </p>
117
+ <p>Please use the prompt template below to achieve the desired result:
118
+ </p>
119
 
 
 
 
 
 
 
 
 
 
 
120
  <b>Prompt</b>:
121
+ <details><code>
122
+ portrait+ style, <b>* the subject * </b>, (high detailed skin:1.2), 8k uhd, dslr, soft lighting, high quality, film grain, realistic, photo-realistic, full length frame, High detail RAW color art, piercing, diffused soft lighting, shallow depth of field, sharp focus, hyperrealism, cinematic lighting
123
+ <br>
 
 
 
 
 
124
  <br>
125
+ <q><i>Example: full body cyborg| full-length portrait| detailed face| symmetric| steampunk| cyberpunk| cyborg| intricate detailed| to scale| hyperrealistic| cinematic lighting| digital art| concept art| mdjrny-v4 style, (high detailed skin:1.2), 8k uhd, dslr, soft lighting, high quality, film grain, Fujifilm XT3
126
+ </i></q>
127
+ </code></details>
128
+ <q><em>Important note: Portrait+ works best at a 1:1 aspect ratio, it is also successful using tall aspect ratios as well.</em></q>
129
+ <br>
130
+ <b>Negative Prompt</b>:
131
+ <details><code>
132
+ lowres, text, error, cropped, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, out of frame, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck, username, watermark, signature
133
+ </code></details>
134
  <br>
135
+ Have Fun & Enjoy <a href="https://www.thafx.com"><abbr title="Website">//THAFX</abbr></a>
136
  <br>
 
137
  </div>
138
  """
139
  )
 
142
  with gr.Column(scale=55):
143
  with gr.Group():
144
  with gr.Row():
145
+ prompt = gr.Textbox(label="Prompt", show_label=False,max_lines=2,placeholder=f"{prefix} [your prompt]").style(container=False)
146
  generate = gr.Button(value="Generate").style(rounded=(False, True, True, False))
147
 
148
  image_out = gr.Image(height=512)
 
152
  with gr.Tab("Options"):
153
  with gr.Group():
154
  neg_prompt = gr.Textbox(label="Negative prompt", placeholder="What to exclude from the image")
155
+ auto_prefix = gr.Checkbox(label="Prefix styling tokens automatically (mdjrny-v4 style,)", value=prefix, visible=prefix)
156
 
157
  with gr.Row():
158
  guidance = gr.Slider(label="Guidance scale", value=7.5, maximum=15)
 
179
 
180
 
181
  demo.queue(concurrency_count=1)
182
+ demo.launch()