rphrp1985 commited on
Commit
3662210
1 Parent(s): 77197c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -11,10 +11,10 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
11
  dtype = torch.float16
12
 
13
  repo = "dataautogpt3/OpenDalleV1.1"
14
- # repo = "stabilityai/stable-diffusion-3-medium"
15
 
16
- # pipe = StableDiffusion3Pipeline.from_pretrained(repo, torch_dtype=torch.float16).to(device)
17
- pipeline = AutoPipelineForText2Image.from_pretrained(repo, torch_dtype=torch.float16).to('cuda')
18
 
19
 
20
  MAX_SEED = np.iinfo(np.int32).max
@@ -27,19 +27,19 @@ def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance
27
  seed = random.randint(0, MAX_SEED)
28
 
29
  # generator = torch.Generator().manual_seed(seed)
30
- image = pipeline(prompt).images[0]
31
 
32
 
33
 
34
- # image = pipe(
35
- # prompt = prompt,
36
- # negative_prompt = negative_prompt,
37
- # guidance_scale = guidance_scale,
38
- # num_inference_steps = num_inference_steps,
39
- # width = width,
40
- # height = height,
41
- # generator = generator
42
- # ).images[0]
43
 
44
  return image, seed
45
 
 
11
  dtype = torch.float16
12
 
13
  repo = "dataautogpt3/OpenDalleV1.1"
14
+ repo = "stabilityai/stable-diffusion-3-medium"
15
 
16
+ pipe = StableDiffusion3Pipeline.from_pretrained(repo, torch_dtype=torch.float16).to(device)
17
+ # pipeline = AutoPipelineForText2Image.from_pretrained(repo, torch_dtype=torch.float16).to('cuda')
18
 
19
 
20
  MAX_SEED = np.iinfo(np.int32).max
 
27
  seed = random.randint(0, MAX_SEED)
28
 
29
  # generator = torch.Generator().manual_seed(seed)
30
+ # image = pipeline(prompt).images[0]
31
 
32
 
33
 
34
+ image = pipe(
35
+ prompt = prompt,
36
+ negative_prompt = negative_prompt,
37
+ guidance_scale = guidance_scale,
38
+ num_inference_steps = num_inference_steps,
39
+ width = width,
40
+ height = height,
41
+ generator = generator
42
+ ).images[0]
43
 
44
  return image, seed
45