generateBG method

TransformationData generateBG(
  1. String? backgroundPrompt,
  2. String? negativePrompt,
  3. int? seed,
  4. int? guidanceScale,
)

Method for Vertex AI based transformations

  • backgroundPrompt : Background prompt (Default: YSBmb3Jlc3QgZnVsbCBvZiBvYWsgdHJlZXMsd2l0aCBicmlnaHQgbGlnaHRzLCBzdW4gYW5kIGEgbG90IG9mIG1hZ2ljLCB1bHRyYSByZWFsaXN0aWMsIDhr)

  • negativePrompt : Negative prompt (Default: )

  • seed : seed (Default: 22)

  • guidanceScale : Guidance Scale (Default: 60)

Returns TransformationData.

Implementation

TransformationData generateBG(
  String? backgroundPrompt,
  String? negativePrompt,
  int? seed,
  int? guidanceScale,
) {
  // Determine if there are values to add to the dictionary

  var values = <String, String>{};

  if (backgroundPrompt != null) {
    values['p'] = backgroundPrompt.toString();
  }

  if (negativePrompt != null) {
    values['np'] = negativePrompt.toString();
  }

  if (seed != null) {
    values['s'] = seed.toString();
  }

  if (guidanceScale != null) {
    values['gs'] = guidanceScale.toString();
  }

  return TransformationData(
      plugin: 'vertexAi', name: 'generateBG', values: values);
}