kolibril13 commited on
Commit
3176086
1 Parent(s): 4a674ae
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -4,6 +4,13 @@ import tempfile
4
 
5
 
6
  def generate():
 
 
 
 
 
 
 
7
  with tempfile.NamedTemporaryFile(suffix=".JPEG", delete=False) as f:
8
  bpy.context.scene.render.resolution_y = 200
9
  bpy.context.scene.render.resolution_x = 400
 
4
 
5
 
6
  def generate():
7
+ bpy.context.scene.cycles.device = 'GPU'
8
+
9
+ prefs = bpy.context.preferences
10
+ prefs.addons['cycles'].preferences.get_devices()
11
+ for device in prefs.addons['cycles'].preferences.devices:
12
+ device.use = True
13
+
14
  with tempfile.NamedTemporaryFile(suffix=".JPEG", delete=False) as f:
15
  bpy.context.scene.render.resolution_y = 200
16
  bpy.context.scene.render.resolution_x = 400