Skip to content

GenerateOptions

Namespace Nfty.Core.Generation in assembly Nfty.Core.

public record GenerateOptions

Everything one generation run needs to know.

Constructors

GenerateOptions(int, string, string?, int, bool, Parallelism?)

public GenerateOptions(int Count, string Seed, string? RecipeId = null, int MaxRerollsPerAsset = 10000, bool EnforceUniqueDna = true, Parallelism? Parallelism = null);

Parameters

  • Count (int) - How many assets to produce.
  • Seed (string) - The string seed driving the RNG. The same cookbook and seed reproduce a run byte for byte, across machine locales and CPU architectures alike.
  • RecipeId (string?) - Restrict the run to one Recipe, overriding the cookbook's weights entirely. Null rolls a Recipe per asset, which is the normal case.
  • MaxRerollsPerAsset (int) - How many times a single asset may be re-rolled before the run gives up — a rule violation and a DNA collision both cost an attempt. Exhausting it raises RuleConflictException or UniqueSpaceExhaustedException depending on which is actually true of the book.
  • EnforceUniqueDna (bool) - When true (the default), every asset must have distinct DNA: a roll colliding with one already produced is discarded and re-rolled, and a run that cannot fill its quota from the unique space fails with UniqueSpaceExhaustedException. When false, every roll is accepted even if its DNA repeats, and identity is carried by the sequential token id (the output number) as ERC-721 defines it — so any Count is producible regardless of the unique space. This skips both the dedup bookkeeping and the space-counting, which is the expensive part of a large run on a slow machine. Incompatibility rules are still enforced either way.
  • Parallelism (Parallelism?) - How wide the render step may run; null means Parallelism.Default. Never changes a result, and is not recorded anywhere.

Fields

DefaultMaxRerolls

public const int DefaultMaxRerolls = 10000;

The reroll budget when a caller does not set one. Shared with the CLI's --max-rerolls default so the two cannot drift apart.

Properties

Count

public int Count { get; init; }

How many assets to produce.

EnforceUniqueDna

public bool EnforceUniqueDna { get; init; }

When true (the default), every asset must have distinct DNA: a roll colliding with one already produced is discarded and re-rolled, and a run that cannot fill its quota from the unique space fails with UniqueSpaceExhaustedException. When false, every roll is accepted even if its DNA repeats, and identity is carried by the sequential token id (the output number) as ERC-721 defines it — so any Count is producible regardless of the unique space. This skips both the dedup bookkeeping and the space-counting, which is the expensive part of a large run on a slow machine. Incompatibility rules are still enforced either way.

MaxRerollsPerAsset

public int MaxRerollsPerAsset { get; init; }

How many times a single asset may be re-rolled before the run gives up — a rule violation and a DNA collision both cost an attempt. Exhausting it raises RuleConflictException or UniqueSpaceExhaustedException depending on which is actually true of the book.

Parallelism

public Parallelism? Parallelism { get; init; }

How wide the render step may run; null means Parallelism.Default. Never changes a result, and is not recorded anywhere.

RecipeId

public string? RecipeId { get; init; }

Restrict the run to one Recipe, overriding the cookbook's weights entirely. Null rolls a Recipe per asset, which is the normal case.

Seed

public string Seed { get; init; }

The string seed driving the RNG. The same cookbook and seed reproduce a run byte for byte, across machine locales and CPU architectures alike.