harmionestark commited on
Commit
90b606d
Β·
verified Β·
1 Parent(s): f52c683

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -50,18 +50,14 @@ def infer(
50
 
51
  generator = torch.Generator(device).manual_seed(seed)
52
 
53
- # Ensure text inputs are moved to the correct device and dtype
54
  prompt = str(prompt) if prompt else ""
55
  negative_prompt = str(negative_prompt) if negative_prompt else ""
56
 
57
- # Convert text inputs to Long tensors if necessary
58
- text_input_ids = torch.tensor([ord(c) for c in prompt], dtype=torch.long, device=device)
59
- neg_text_input_ids = torch.tensor([ord(c) for c in negative_prompt], dtype=torch.long, device=device)
60
-
61
  image = pipe(
62
- prompt=text_input_ids,
63
- negative_prompt=neg_text_input_ids,
64
- guidance_scale=torch.tensor(guidance_scale, dtype=torch.float32, device=device),
65
  num_inference_steps=num_inference_steps,
66
  width=width,
67
  height=height,
 
50
 
51
  generator = torch.Generator(device).manual_seed(seed)
52
 
53
+ # Ensure text inputs are strings
54
  prompt = str(prompt) if prompt else ""
55
  negative_prompt = str(negative_prompt) if negative_prompt else ""
56
 
 
 
 
 
57
  image = pipe(
58
+ prompt=prompt,
59
+ negative_prompt=negative_prompt,
60
+ guidance_scale=guidance_scale,
61
  num_inference_steps=num_inference_steps,
62
  width=width,
63
  height=height,