ehristoforu commited on
Commit
1c5a58a
1 Parent(s): 54b21f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -10
app.py CHANGED
@@ -28,13 +28,13 @@ device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
28
 
29
 
30
  if torch.cuda.is_available():
31
- pipe_3_5 = StableDiffusionPipeline.from_pretrained(
32
- "fluently/Fluently-v3.5",
33
  torch_dtype=torch.float16,
34
  use_safetensors=True,
35
  )
36
- pipe_3_5.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe_3_5.scheduler.config)
37
- pipe_3_5.to(device)
38
 
39
  pipe_anime = StableDiffusionPipeline.from_pretrained(
40
  "fluently/Fluently-anime",
@@ -53,7 +53,7 @@ if torch.cuda.is_available():
53
  pipe_epic.to(device)
54
 
55
  pipe_inpaint = StableDiffusionInpaintPipeline.from_pretrained(
56
- "fluently/Fluently-v3-inpainting",
57
  torch_dtype=torch.float16,
58
  use_safetensors=True,
59
  )
@@ -84,7 +84,7 @@ def randomize_seed_fn(seed: int, randomize_seed: bool) -> int:
84
  return seed
85
 
86
  def get_model(model):
87
- if model == "Fluently v3 inpaint":
88
  return gr.update(visible=True), gr.update(visible=True), gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
89
  else:
90
  return gr.update(visible=False), gr.update(visible=False), gr.update(visible=False), gr.update(visible=False), gr.update(visible=False)
@@ -113,8 +113,8 @@ def generate(
113
 
114
  if not use_negative_prompt:
115
  negative_prompt = "" # type: ignore
116
- if model == "Fluently v3.5":
117
- images = pipe_3_5(
118
  prompt=prompt,
119
  negative_prompt=negative_prompt,
120
  width=width,
@@ -209,8 +209,8 @@ with gr.Blocks(title="Fluently Playground", css=css) as demo:
209
  with gr.Row():
210
  model = gr.Radio(
211
  label="Model",
212
- choices=["Fluently XL v2", "Fluently v3.5", "Fluently Anime", "Fluently Epic", "Fluently v3 inpaint"],
213
- value="Fluently v3.5",
214
  interactive=True,
215
  )
216
 
@@ -239,6 +239,7 @@ with gr.Blocks(title="Fluently Playground", css=css) as demo:
239
  negative_prompt = gr.Text(
240
  label="Negative prompt",
241
  max_lines=5,
 
242
  value="""(deformed, distorted, disfigured:1.3), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, (mutated hands and fingers:1.4), disconnected limbs, mutation, mutated, ugly, disgusting, blurry, amputation""",
243
  placeholder="Enter a negative prompt",
244
  visible=False,
 
28
 
29
 
30
  if torch.cuda.is_available():
31
+ pipe_4 = StableDiffusionPipeline.from_pretrained(
32
+ "fluently/Fluently-v4",
33
  torch_dtype=torch.float16,
34
  use_safetensors=True,
35
  )
36
+ pipe_4.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe_4.scheduler.config)
37
+ pipe_4.to(device)
38
 
39
  pipe_anime = StableDiffusionPipeline.from_pretrained(
40
  "fluently/Fluently-anime",
 
53
  pipe_epic.to(device)
54
 
55
  pipe_inpaint = StableDiffusionInpaintPipeline.from_pretrained(
56
+ "fluently/Fluently-v4-inpainting",
57
  torch_dtype=torch.float16,
58
  use_safetensors=True,
59
  )
 
84
  return seed
85
 
86
  def get_model(model):
87
+ if model == "Fluently v4 inpaint":
88
  return gr.update(visible=True), gr.update(visible=True), gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
89
  else:
90
  return gr.update(visible=False), gr.update(visible=False), gr.update(visible=False), gr.update(visible=False), gr.update(visible=False)
 
113
 
114
  if not use_negative_prompt:
115
  negative_prompt = "" # type: ignore
116
+ if model == "Fluently v4":
117
+ images = pipe_4(
118
  prompt=prompt,
119
  negative_prompt=negative_prompt,
120
  width=width,
 
209
  with gr.Row():
210
  model = gr.Radio(
211
  label="Model",
212
+ choices=["Fluently XL v2", "Fluently v4", "Fluently Anime", "Fluently Epic", "Fluently v4 inpaint"],
213
+ value="Fluently v4",
214
  interactive=True,
215
  )
216
 
 
239
  negative_prompt = gr.Text(
240
  label="Negative prompt",
241
  max_lines=5,
242
+ lines=4,
243
  value="""(deformed, distorted, disfigured:1.3), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, (mutated hands and fingers:1.4), disconnected limbs, mutation, mutated, ugly, disgusting, blurry, amputation""",
244
  placeholder="Enter a negative prompt",
245
  visible=False,