Manjushri commited on
Commit
7e57f12
·
verified ·
1 Parent(s): d44533a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -3,13 +3,13 @@ import torch
3
  import numpy as np
4
  import modin.pandas as pd
5
  from PIL import Image
6
- from diffusers import CogView4Pipeline
7
  from huggingface_hub import hf_hub_download
8
 
9
  device = 'cuda' if torch.cuda.is_available() else 'cpu'
10
  torch.cuda.max_memory_allocated(device=device)
11
  torch.cuda.empty_cache()
12
- pipe = CogView4Pipeline.from_pretrained("THUDM/CogView4-6B", torch_dtype=torch.bfloat16)
13
 
14
  # Open it for reduce GPU memory usage
15
  pipe.enable_model_cpu_offload()
@@ -24,8 +24,8 @@ def genie (Model, Prompt, negative_prompt, height, width, scale, steps, seed):
24
  guidance_scale=scale,
25
  num_images_per_prompt=1,
26
  num_inference_steps=steps,
27
- width=768,
28
- height=768,).images[0]
29
 
30
  return image
31
 
 
3
  import numpy as np
4
  import modin.pandas as pd
5
  from PIL import Image
6
+ from diffusers import FluxPipeline
7
  from huggingface_hub import hf_hub_download
8
 
9
  device = 'cuda' if torch.cuda.is_available() else 'cpu'
10
  torch.cuda.max_memory_allocated(device=device)
11
  torch.cuda.empty_cache()
12
+ pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
13
 
14
  # Open it for reduce GPU memory usage
15
  pipe.enable_model_cpu_offload()
 
24
  guidance_scale=scale,
25
  num_images_per_prompt=1,
26
  num_inference_steps=steps,
27
+ width=width,
28
+ height=height, generator=generator).images[0]
29
 
30
  return image
31